Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



3 answers

Permanent link
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!

0 votes


Permanent link
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?

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

0 votes


Permanent link
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?

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!

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,941

Question asked: Jan 23 '09, 6:05 p.m.

Question was seen: 7,302 times

Last updated: Jan 23 '09, 6:05 p.m.

Confirmation Cancel Confirm