How to find work item filed against category value

2019-06-04 01:55发布

I am using below code and found filed against category object but there I am not able to find the value. Please help.

IProjectAreaHandle projectAreaHandle = workItem.getProjectArea();

                IAttribute someAttribute = workItemClient.findAttribute(projectAreaHandle, IWorkItem.CATEGORY_PROPERTY,
                        monitor);



    IAttributeHandle iAttributeHandle = (IAttributeHandle) someAttribute;
                    IAttribute iAttribute = (IAttribute) repo
                        .itemManager().fetchCompleteItem(
                        iAttributeHandle, IItemManager.DEFAULT ,monitor);

                    Object value = workItem.getValue(iAttribute);

1条回答
聊天终结者
2楼-- · 2019-06-04 02:24

Below code will help to find out the filed against attribute value :

 ICategoryHandle iCategoryHandle = workItem.getCategory();
                ICategory iCategory1 = (ICategory) repo
                        .itemManager().fetchCompleteItem(
                                iCategoryHandle, IItemManager.DEFAULT ,monitor);
                return iCategory1.getName();
查看更多
登录 后发表回答