Parse JQL query
POST
/rest/api/3/jql/parse
JQL
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://jira.local:8080/jira/rest//rest/api/3/jql/parse' \
--header 'Content-Type: application/json' \
--data-raw '{
"queries": [
"summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy = currentUser()) AND status CHANGED AFTER startOfMonth(-1M) ORDER BY updated DESC",
"issue.property[\"spaces here\"].value in (\"Service requests\", Incidents)",
"invalid query",
"summary = test",
"summary in test",
"project = INVALID",
"universe = 42"
]
}'
Response Response Example
200 - Success
{
"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",
"encodedName": "summary"
},
"operator": "~",
"operand": {
"value": "test",
"encodedValue": "test"
}
},
{
"clauses": [
{
"field": {
"name": "labels",
"encodedName": "labels"
},
"operator": "in",
"operand": {
"values": [
{
"value": "urgent",
"encodedValue": "urgent"
},
{
"value": "blocker",
"encodedValue": "blocker"
}
],
"encodedOperand": "urgent, blocker)"
}
},
{
"field": {
"name": "lastCommentedBy",
"encodedName": "lastCommentedBy",
"property": [
{
"entity": "issue",
"key": "propertyKey",
"path": "path.in.property",
"type": "user"
}
]
},
"operator": "=",
"operand": {
"function": "currentUser",
"arguments": [],
"encodedOperand": "currentUser()"
}
}
],
"operator": "or"
},
{
"field": {
"name": "status",
"encodedName": "status"
},
"operator": "changed",
"predicates": [
{
"operator": "after",
"operand": {
"function": "startOfMonth",
"arguments": [
"-1M"
],
"encodedOperand": "startOfMonth(-1M)"
}
}
]
}
],
"operator": "and"
},
"orderBy": {
"fields": [
{
"field": {
"name": "updated",
"encodedName": "updated"
},
"direction": "desc"
}
]
}
}
},
{
"query": "issue.property[\"spaces here\"].value in (\"Service requests\", Incidents)",
"structure": {
"where": {
"field": {
"name": "issue.property[spaces here].value",
"encodedName": "issue.property[\"spaces here\"].value",
"property": [
{
"entity": "issue",
"key": "spaces here",
"path": "value"
}
]
},
"operator": "in",
"operand": {
"values": [
{
"value": "Service requests",
"encodedValue": "\"Service requests\""
},
{
"value": "Incidents",
"encodedValue": "Incidents"
}
],
"encodedOperand": "(\"Service requests\", Incidents)"
}
}
}
},
{
"query": "invalid query",
"errors": [
"Error in the JQL Query: Expecting operator but got 'query'. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', '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."
]
}
]
}
Request
Query Params
validation
stringÂ
optional
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.Body Params application/json
Responses
Modified at 2023-07-13 03:27:27