Group Criteria and Query API

Does anyone know how to add bracketed groupings to a query API script?  For instance, this query criteria, as it would to a user in web client, returns the exception “Workflow.Duration must be used in a group criteria that contains only Cover Page.Status with IN operator as an additional criteria”.  In the web client, you add brackets to the left and right side of the criteria to group them, but I can’t seem to get that same sort of thing to work in the query API. 

query.setCriteria(“[Cover Page.Status] in (‘Default Change Orders.CCB Review’) and [Workflow.Duration] > ‘2160’”);

Does anyone know how to get the above query to work?

No Files Were Attached
Matt Paulhus Agile Angel Asked on January 29, 2018 in Other APIs.

Note that the first obvious fix, as seen below, returns a syntax error (at position 95):

query.setCriteria(“[[Cover Page.Status] in (‘Change Notice Workflow.CCB Review’) and [Workflow.Duration] > ‘2160’]”);

on January 29, 2018.
Add Comment
4 Answer(s)

Please use “(” instead of “[” and try out.

madhusudanas Agile Angel Answered on January 30, 2018.
Add Comment

Hi madhusudanas,

Using parentheses in that way instead like so gives me the error “Cant support nested workflow search criteria grouping.”

query.setCriteria(“([Cover Page.Status] in (‘Default Change Orders.CCB Review’) and [Workflow.Duration] > ‘2160’)”);

Does anyone know the escape character for brackets?  Is that what I’m missing?

Matt Paulhus Agile Angel Answered on February 1, 2018.
Add Comment

Can you please try the following. I removed the braces for ‘Default Change Orders.CCB Review’

query.setCriteria(“([Cover Page.Status] in ‘Default Change Orders.CCB Review’ and [Workflow.Duration] > ‘2160’)”);

madhusudanas Agile Angel Answered on February 2, 2018.
Add Comment

I’m afraid that received the same error message: “Cant support nested workflow search criteria grouping.”

Odd, huh?  There’s no documentation on how to do this in the API guide.

And to think that this advanced search works just fine but recreating the same thing as an IQuery does not.

Matt Paulhus Agile Angel Answered on February 2, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.