Q. I would like to search issues with two conditions combined using this:
For example, I want Safety Issues that were created on or after September 1, 2016.
I am able to search on a single condition. The documentation suggests like this:
but I can’t get anything that resembles this to work.
A. The documentation is correct, but it probably needs a little clarification. Quotation marks (“”) and escape makes (\) make it difficult to tell the logic behind it.
A condition is defined as a string of a form:
Condition = field_identifier,operator,”condition_value”
Notice that condition_value is wrapped with quotation marks (“”). As an example, let’s say, we have two conditions A and B as follows:
Condition_A = created_at,geq,\"2015-01-01\" Condition_B = f--issue_type_id,eq,\"98f6738e-97ce-11e2-a4be-02cc3afa57bd\"
Then conditions parameter is defined as a list () of each condition separated by comma (,).
conditions = [“condition_A”,”condition_B”]
Notice that I’m wrapping each condition with quotation mark (“”), which makes each condition as one string.
Putting together, the conditions parameter looks like this:
conditions = ["created_at,geq,\"2015-01-01\"","f--issue_type_id,eq,\"98f6738e-97ce-11e2-a4be-02cc3afa57bd\""]
Depending on the tools and programming language you are using, you may further need to elaborate with escape character while passing the parameter to your actual REST call.
For topics related to search issues, please take a look the follow posts: