Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Snippet Library: JQL - Simplifying Complex Queries

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.


Back to intro or article list

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events