It's all about the answers!

Ask a question

Is it possible to combine "and" and "or" operations in the oslc.where clause?


Binoy D'costa (9532737) | asked Dec 11 '17, 3:53 p.m.
edited Dec 11 '17, 3:54 p.m.

 I have an olsc query that filters on resolution value. It works fine with one value, but I need to filter on multiple values of Resolution. Is this possible?


Working example:


I need to filter where= com.team.ibm.workitem.workflow.defect.resolution.r5 or com.team.ibm.workitem.workflow.defect.resolution.r9 

Is this possible?

Thanks,
Binoy

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Dec 11 '17, 7:18 p.m.
edited Dec 11 '17, 7:19 p.m.

Unfortunately you cannot do it by using "OR", as OSLC does not allow the "OR" operator. Try "IN".

boolean_op

The boolean_op term represents a boolean operation that lets you combine simple boolean expressions to form a compound boolean expression.

The only boolean operation allowed is " and " which represents conjunction. The boolean operator " or " for disjunction is not allowed in the interests of keeping the syntax simple. The effect of " or " in the simple case of testing a property for equality with one of several values can be achieved through the use of the " in " operator. For example, the following query finds bugs with severity " high " or " medium ":

 http://example.com/bugs?oslc.where=cm:severity in ["high","medium"]

</pre>

https://open-services.net/bin/view/Main/OSLCCoreSpecQuery

Binoy D'costa selected this answer as the correct answer

Comments
Binoy D'costa commented Dec 11 '17, 9:37 p.m.

  Thanks, this worked!

Your answer


Register or 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.