从团队区域获取所有工作项

Getting All Workitems from Team Area

我有以下对象:

ITeamRepository repo;
IProjectArea projArea;
ITeamArea teamArea;

获得projAreateamArea的过程非常简单(尽管涉及的对象数量众多)。但是,我似乎无法找到一种方法来直接获取包含与这些对象关联的所有工作项的列表。这是否可以直接实现,可能是通过 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 the IProjectArea pointer to the current project as you loop through the List of project areas p in your code.

The IQueryResult object 'results' then contains a list of IResolvedResult records with all of the work items for that project you can iterate through and find properties for each work item.