如何使用普通 java api 查找根据类别值归档的工作项?

How to find work item filed against category value using plain java api?

我正在使用下面的代码并找到针对类别对象的文件,但我无法找到该值。请帮忙。

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);

下面的代码将有助于找出针对属性值的归档:

 ICategoryHandle iCategoryHandle = workItem.getCategory();
                ICategory iCategory1 = (ICategory) repo
                        .itemManager().fetchCompleteItem(
                                iCategoryHandle, IItemManager.DEFAULT ,monitor);
                return iCategory1.getName();