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

How query workItem by some attributes in java code?

How query workItem by some attributes in java code?

Hello,every one ,I have a question that is

How query workItem by some attributes in java code?

for example : I want to find out the workItem's count by owner="Jurry" and
workitemtype="requeriment" and severity="high" ??
can some one tell me some solutionin java code??


in additional
there I found some code

IAttribute attribute_001 = workItemClient.findAttribute(projectArea, "com.ibm.team.workitem.attribute.severity", null);

IQueryableAttribute attribute_002= findAttribute(projectArea, auditableClient, "com.ibm.team.workitem.attribute.owner", null);
if(null!=attribute_001)
{
logger.info("----"+attribute_001+"----");
}
AttributeExpression attrExpression_001= new AttributeExpression(attribute_002, AttributeOperation.EQUALS, password);
AttributeExpression attrExpression_002= new AttributeExpression(attribute_002, AttributeOperation.EQUALS, password);

//SimilarityExpression similarityExpression= new SimilarityExpression(workItemType,null);
Term term= new Term(Operator.AND);
term.add(attrExpression_001);
term.add(attrExpression_002);

IQueryResult ddd = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.SMALL_PROFILE);
ResultSize ffff = ddd.getResultSize(null);
logger.info(ffff.getTotal());


Thank you very much!!!

0 votes



One answer

Permanent link
How query workItem by some attributes in java code?

Hello,every one ,I have a question that is

How query workItem by some attributes in java code?

for example : I want to find out the workItem's count by owner="Jurry" and
workitemtype="requeriment" and severity="high" ??
can some one tell me some solutionin java code??


in additional
there I found some code

IAttribute attribute_001 = workItemClient.findAttribute(projectArea, "com.ibm.team.workitem.attribute.severity", null);

IQueryableAttribute attribute_002= findAttribute(projectArea, auditableClient, "com.ibm.team.workitem.attribute.owner", null);
if(null!=attribute_001)
{
logger.info("----"+attribute_001+"----");
}
AttributeExpression attrExpression_001= new AttributeExpression(attribute_002, AttributeOperation.EQUALS, password);
AttributeExpression attrExpression_002= new AttributeExpression(attribute_002, AttributeOperation.EQUALS, password);

//SimilarityExpression similarityExpression= new SimilarityExpression(workItemType,null);
Term term= new Term(Operator.AND);
term.add(attrExpression_001);
term.add(attrExpression_002);

IQueryResult ddd = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.SMALL_PROFILE);
ResultSize ffff = ddd.getResultSize(null);
logger.info(ffff.getTotal());


Thank you very much!!!


You can use the RQM REST API (http://jazz.net/wiki/bin/view/Main/RqmApi) to GET work items. However, the API does not provide query support so you will have filter the results based on your predicate(s). The fields parameter (https://jazz.net/wiki/bin/view/Main/RqmApi#fields) is intended for filtering results but does not support work items (https://jazz.net/wiki/bin/view/Main/RqmApi#SupportedFieldsResources). You may open an enhancement for adding this support.

In addition, you may use the RTC API (https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2) to get, create, modify, and query work items.

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

Question asked: Mar 02 '11, 12:26 a.m.

Question was seen: 4,537 times

Last updated: Mar 02 '11, 12:26 a.m.

Confirmation Cancel Confirm