How to get workitems list of specific type
4 answers
you will need to create a workitem query object, and execute that to get the list..
see this topic getting-work-items-through-plain-java-api
see this topic getting-work-items-through-plain-java-api
If I understand what you're trying to do, you would need to create a work item query where one of the conditions is Type. You could then run the query via the web ui and click the "Download as Spreadsheet" icon, or in the Eclipse UI, go to File->Export, expand Team, select Work Items, then select your query.
public void getWorkItemsByType(String type) throws TeamRepositoryException {
IAuditableClient auditableClient = (IAuditableClient) getRepository()
.getClientLibrary(IAuditableClient.class);
IQueryClient queryClient = (IQueryClient) getRepository().getClientLibrary(
IQueryClient.class);
IQueryableAttribute attribute = QueryableAttributes.getFactory(
IWorkItem.ITEM_TYPE).findAttribute(getProjectArea(),
IWorkItem.TYPE_PROPERTY, auditableClient, null);
IWorkItemClient workItemClient = (IWorkItemClient) getRepository()
.getClientLibrary(IWorkItemClient.class);
List<IWorkItemType> types = workItemClient.findWorkItemTypes(
getProjectArea(), null);
String ppp = types.get(0).getIdentifier();
Expression expression = new AttributeExpression(attribute,
AttributeOperation.EQUALS, type);
IQueryResult<IResolvedResult<IWorkItem>> results = queryClient
.getResolvedExpressionResults(getProjectArea(), expression,
IWorkItem.FULL_PROFILE);
}
It may be useful for someone