我有以下对象:
ITeamRepository repo;
IProjectArea projArea;
ITeamArea teamArea;
获取projArea
和teamArea
的过程非常简单(尽管涉及的对象数量很多)。但是,我似乎无法找到一种方法来直接获取包含与这些对象关联的所有工作项的列表。这是否可以直接通过 IQueryClient
对象实现?
最佳答案
这个2012 thread (所以它可能已经改变)建议:
I used the following code to get the work items associated with each project area:
auditableClient = (IAuditableClient) repository.getClientLibrary(IAuditableClient.class);
IQueryClient queryClient = (IQueryClient) repository.getClientLibrary(IQueryClient.class);
IQueryableAttribute attribute = QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(currProject, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, null);
Expression expression = new AttributeExpression(attribute, AttributeOperation.EQUALS, currProject);
IQueryResult<IResolvedResult<IWorkItem>> results = queryClient.getResolvedExpressionResults(currProject, expression, IWorkItem.FULL_PROFILE);
In my code,
currProject
would be theIProjectArea
pointer to the current project as you loop through theList
of project areasp
in your code.The
IQueryResult
object 'results
' then contains a list ofIResolvedResult
records with all of the work items for that project you can iterate through and find properties for each work item.
关于java - 从团队区域获取所有工作项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42078102/