Jira Cloud JQL: Understanding Query Order of Operations

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

When using JQL for Work Item Filters/Queues/SLAs/Automation, sometimes the query unexpectedly returns unwanted work items. Why does this happen? How can we optimize these queries and ensure that incorrect work items are not returned?

The first thing we need to understand is the order of operations for Jira Query Language and how keywords and operators are prioritized in a query.

Solution

Cause - Order of Operations

Please see the full list of operators and statements listed from strongest binding to the weakest:

  1. Parentheses ()

  2. Comparison (=, !=, >=, IS, IS NOT, IN, NOT IN, ~, !~, ...)

  3. Negation (NOT)

  4. AND

  5. OR

For example, the AND statement has a stronger binding than the OR statement, meaning the query will have a more refined search than the OR statement. In this scenario, the OR statement can return more work items, causing incorrect results when JQL is used.

Example Queries

This query is evaluated from left to right, where the parentheses take precedence, then the AND statement, then the OR statement

(status=resolved AND project=SysAdmin) OR assignee=bobsmith

This query will also evaluate from left to right, where the NOT IN statements take precedence, then the AND statement

reporter NOT IN (Jack,Jill,John) AND assignee NOT IN (Jack,Jill,John)

This query is evaluated from the comparisons first (< and IS), then the OR statement

duedate < now() OR duedate IS EMPTY

This query evaluates the parentheses first, then the comparison (=), then the OR statement, then the negation (NOT)

NOT (reporter = jsmith or reporter = jbrown)

Next Step(s)

When configuring any JQL query anywhere within your site, it is important to keep this order of operations in mind to avoid incorrect work items being picked up by the query, regardless of the configuration.

Relevant Documentation

Updated on June 13, 2025

Still need help?

The Atlassian Community is here for you.