How to get the available work items in a Project Area
![]()
Hello,
We are new to using the Jazz APIs and we are trying to get all the available work items (specifically Defects) in a certain Project Area. Can anyone please help us out on how to get started? We have read the following https://jazz.net/wiki/bin/view/Main/QueryDevGuide; however, when it gets to the following line IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectAreaHandle, projectExpression, profile); we get an InvocationTargetException. Any help would be appreciated and I apologize for the lack of knowledge as we are still trying to learn it all. Thank you. |
3 answers
![]()
Hi,
I'm new to the Jazz Api as well and I'm facing the similar issue. I want to know how to get all the existing work items from the project area using the Jazz Api. Any help is appreciated. I'm at the point where I got the IProjectArea and IProjectAreaHandle objects. How can I get all the work items from this point on? Many thanks! |
![]() I'm new to the Jazz Api as well and I'm facing the similar issue. I Possibility 1) IProjectAreaHandle projectArea=...; IAuditableClient auditableClient=...; IQueryClient queryClient=... IQueryableAttribute attribute= QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, monitor); Expression expression= new AttributeExpression(attribute, AttributeOperation.EQUALS, projectArea); IQueryResult<IResolvedResult<IWorkItem>> results= queryClient.getResolvedExpressionResults(projectArea, expression, IWorkItem.SMALL_PROFILE); Possibility 2) IProjectAreaHandle projectArea=...; IAuditableClient auditableClient=...; IItemQuery query= IItemQuery.FACTORY.newInstance(WorkItemQueryModel.ROOT); IPredicate predicate= WorkItemQueryModel.ROOT.projectArea()._eq(query.newItemHandleArg()) query.filter(predicate); ItemQueryIterator<IWorkItemHandle> iterator= new ItemQueryIterator<IWorkItemHandle>(auditableClient, query, new Object[] { projectArea }); -- Regards, Patrick Jazz Work Item Team |
![]() I'm new to the Jazz Api as well and I'm facing the similar issue. I Possibility 1) IProjectAreaHandle projectArea=...; IAuditableClient auditableClient=...; IQueryClient queryClient=... IQueryableAttribute attribute= QueryableAttributes.getFactory(IWorkItem.ITEM_TYPE).findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, monitor); Expression expression= new AttributeExpression(attribute, AttributeOperation.EQUALS, projectArea); IQueryResult<IResolvedResult<IWorkItem>> results= queryClient.getResolvedExpressionResults(projectArea, expression, IWorkItem.SMALL_PROFILE); Possibility 2) IProjectAreaHandle projectArea=...; IAuditableClient auditableClient=...; IItemQuery query= IItemQuery.FACTORY.newInstance(WorkItemQueryModel.ROOT); IPredicate predicate= WorkItemQueryModel.ROOT.projectArea()._eq(query.newItemHandleArg()) query.filter(predicate); ItemQueryIterator<IWorkItemHandle> iterator= new ItemQueryIterator<IWorkItemHandle>(auditableClient, query, new Object[] { projectArea }); -- Regards, Patrick Jazz Work Item Team Thank you, this helped! |