Parse Jql Query
POST {{baseUrl}}/rest/api/3/jql/parse?validation=strict
Parses and validates JQL queries.
Validation is performed in context of the current user.
This operation can be accessed anonymously.
Permissions required: None.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
validation | string | How to validate the JQL query and treat the validation results. Validation options include: |
strict
Returns all errors. If validation fails, the query structure is not returned.warn
Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is returned.none
No validation is performed. If JQL query is correctly formed, the query structure is returned. |
Request Body
{"queries"=>["<string>", "<string>"]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"queries":[{"query":"summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy = currentUser()) AND status CHANGED AFTER -5d ORDER BY updated DESC","structure":{"where":{"clauses":[{"field":{"name":"summary"},"operator":"~","operand":{"value":"test"}},{"clauses":[{"field":{"name":"labels"},"operator":"in","operand":{"values":[{"value":"urgent"},{"value":"blocker"}]}},{"field":{"name":"lastCommentedBy","property":[{"entity":"issue","key":"propertyKey","path":"path.in.property","type":"user"}]},"operator":"=","operand":{"function":"currentUser","arguments":[]}}],"operator":"or"},{"field":{"name":"status"},"operator":"changed","predicates":[{"operator":"after","operand":{"function":"startOfMonth","arguments":["-1M"]}}]}],"operator":"and"},"orderBy":{"fields":[{"field":{"name":"updated"},"direction":"desc"}]}}},{"query":"invalid query","errors":["Error in the JQL Query: Expecting operator but got 'query'. The valid operators are '=', '!=', '\u003c', '\u003e', '\u003c=', '\u003e=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 9)"]},{"query":"summary = test","errors":["The operator '=' is not supported by the 'summary' field."]},{"query":"summary in test","errors":["Operator 'in' does not support the non-list value '\"test\"' for field 'summary'."]},{"query":"project = INVALID","errors":["The value 'INVALID' does not exist for the field 'project'."]},{"query":"universe = 42","errors":["Field 'universe' does not exist or you do not have permission to view it."]}]}