It's all about the answers!

Ask a question

How to join expressions using term to get the specific workitems


Sridhar Kuna (1602017) | asked Sep 15 '15, 1:30 p.m.
I want to get defect WorkItems which have foundIn values assigned to either Test1 or Test2 (for example) for particular project. so i have two expressions related to these found in values

Term term1 = new Term(Operator.AND);
term1.add(projectAreaExpression); //For particular project
term1.add(workItemTypeExpression); //For workitem type defect

Term term2 = new Term(Operator.OR);
term2.add(foundIn1Expression); //For found in value set to Test1
term2.add(foundIn2Expression); //For found in value set to Test2

How can we join these 2 terms that we can use it below to get the specific workItems?

com.ibm.team.workitem.common.query.IQueryResult<iresolvedresult<iworkitem>> results = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE);

One answer



permanent link
Sridhar Kuna (1602017) | answered Sep 19 '15, 1:58 p.m.
I have figured out the way to achieve this as below.
--------------------------
term1.add(term2);
com.ibm.team.workitem.common.query.IQueryResult<iresolvedresult<iworkitem>> results = queryClient.getResolvedExpressionResults(projectArea, term1, IWorkItem.FULL_PROFILE);
-------------------------
class Term extends Expression so you can add term as well in place of expression.

Your answer


Register or to post your answer.