JQL queries combine multiple clauses, fields, operators, functions, values, and keywords to help us filter work quickly and with precision. But sometimes, we ask Jira to do too much. If queries are too complex, Jira may have trouble determining which data is included. Further, it might not be able to check the needed user access permissions. (Jira only returns items the specific user has access to see.)
The following examples show complex JQL queries with broad result scopes and how to narrow them down to avoid problems.
Example 1
Complex
assignee = currentUser()
Simplified
project = KEY and assignee = currentUser()
Example 2
Complex
project = KEY OR fixVersion = 1.0.0
Simplified
project = KEY AND fixVersion = 1.0.0
Example 3
Complex
<clause> AND (<clause> OR <clause>) AND (<clause> OR <clause>)
Simplified
<clause> OR (<clause> AND <clause>) OR <clause> OR (<clause> AND <clause>)
Also see Atlassian’s guidelines for writing efficient JQL queries.
Rachel Wright
0 comments