Help with Expression & Terms in RTC Plain Java API
In my Java application I am building a Query using Expressions & Term to query for Work items
One of my conditions looks like below - Status ("Unresolved") AND - Filed Against ("SW" OR "HW") Term typeinProjectArea= new Term(Term.Operator.AND); typeinProjectArea.add(exprstates); Term trmFilter = new Term (Term.Operator.OR); trmFilter.add(exprFildAgainst1); IQueryClient queryClient = workItemClient.getQueryClient(); com.ibm.team.workitem.common.query.IQueryResult<IResult> results = queryClient.getExpressionResults(oProjectArea,typeinProjectArea);In the above code I can pass only one expression How can I build an expression which has nested AND/OR conditions |
Accepted answer
Karthik,
public class Term extends Expression --> this means you can Term.add(anotherTerm); So in your case: orTerm.add(filedAgainstHW); orTerm.add(filedAgainstSW); andTerm.add(typeInProjectArea); andTerm.add(orTerm); That should do the job. If this answers your question please mark it as accepted. gg, Arne Karthik Krishnan selected this answer as the correct answer
Comments
Karthik Krishnan
commented Sep 01 '15, 4:04 a.m.
Thanks Arne,
|
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.
Comments
ignore the variable names :)
Is this possible at all via API?