JQL with OR results in error.
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
While trying to run an advanced JQL query such as:
Code
1
project = IT AND status = Open OR project =test
it will result in the below error:

Even though the first two statement are true and the third statement is in "OR" clause.
When making the following actions...
Create a JQL with and OR operand.
Make sure the first statement is correct.
Type a random value for the filed after the "OR" operand.
Diagnosis
Environment
The scenario was tested in the latest version of JIRA 7.1.9
PostGres SQL
Diagnostic Steps
Run a JQL with a value that does not exist for a field. For example, in the below JQL:
project = IT AND status = Open OR project =test
the value "test" does not exist for the Field "project".
It does not matter if it is with the OR section.
Cause
The main cause is that JIRA can not search for a value that does not exist and it is equivalent to looking for NULL. It may seem that it is using an "OR" operand but the value needs to be present in order for the JQL to process.
Solution
Resolution
Please make sure that the value exist for the filed that you are trying to search.
Was this helpful?