JQL with OR results in error.

This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Restricted functions in Atlassian Cloud apps, the contents of this article cannot be applied to Atlassian Cloud applications.

Problem

While trying to run an advanced JQL query such as:

Code
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.

Resolution

Please make sure that the value exist for the filed that you are trying to search.

 

Last modified on Aug 18, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.