我正在使用下面的代码,它会返回一些关于“针对”的信息 属性。但是我在那里找不到属性数据。请帮忙
IAttribute someAttribute= workItemClient.findAttribute(projectAreaHandle, workItem.CATEGORY_PROPERTY, monitor);
使用下面的代码通过 Id 找出工作项:
workItemClient = (IWorkItemClient) repo.getClientLibrary(IWorkItemClient.class);
int id = new Integer("339406").intValue();
IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.FULL_PROFILE, monitor);
使用此工作项,我想获取与该工作项相关的父项和子项,例如 Epic 和故事工作项。然后是故事状态、故事计划等属性。
最佳答案
来自 this thread :
You can't just put a string in there, I think.
You have to find the category object from the string and then put in theICategory
object.
这意味着:
private static String CATEGORY_NAME = "UI1";
List<ICategory> findCategories = workItemCommon.findCategories(projectArea, ICategory.FULL_PROFILE, monitor);
for(ICategory category : findCategories) {
if(category.getName().contains(CATEGORY_NAME)){
filedAgainstAttribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.CATEGORY_PROPERTY, auditableClient, monitor);
filedAgainstExpression = new AttributeExpression(filedAgainstAttribute, AttributeOperation.EQUALS, category);
}
}
关于java - 如何使用 java API 获取 RTC 工作项属性数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49317439/