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

How to query workitems in open state ?

I want to query workitems in open state by using client java API, but the following code doesn't work, anyone can help me?

IQueryableAttribute queryableAttribute1 = factory.findAttribute(projectArea, IWorkItem.STATE_PROPERTY, auditableClient, null);

Identifier sIdentifier1 = Identifier.create (com.ibm.team.workitem.common.model.IState.class, String.valueOf(IWorkflowInfo.OPEN_STATES));
AttributeExpression projectAreaExpression1 = new AttributeExpression(queryableAttribute1, AttributeOperation.EQUALS, sIdentifier1);

Term term = new Term(Operator.AND);
term.add(projectAreaExpression1);
IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.SMALL_PROFILE);

IAttribute idAttribute = workItemClient.findAttribute(projectArea, IWorkItem.ID_PROPERTY, null);
while (result.hasNext(null)) {
IResolvedResult<IWorkItem> resolved = result.next(null);
wi = resolved.getItem();
System.out.println(wi.getValue(idAttribute));
}




I also tried this:

AttributeExpression projectAreaExpression1 = new AttributeExpression(queryableAttribute1, AttributeOperation.EQUALS, new StatusVariable(IWorkflowInfo.OPEN_STATES));



They all doesn't work. Am I using query API incorrect?

0 votes



One answer

Permanent link
Am I using query API incorrect?
See https://jazz.net/forum/questions/41555/building-a-query-for-work-items-in-closed-state-group/131452
Cheers.

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,955

Question asked: Apr 21 '11, 6:29 a.m.

Question was seen: 4,260 times

Last updated: Sep 02 '15, 9:22 a.m.

Confirmation Cancel Confirm