Why my JQL search with "not in" or "!=" (not equals) operators has issues missing

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

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

When performing a JQL search for issues not in a category or without a label, for example, using the "not in" or "!=" (not equals) operators, some are left out.

Cause

Some fields in Jira are actually relationships. When we tell JQL something like:

assignee not in ("user1","user2")

As described in Advanced search reference - JQL operators, what Jira really understands is: "to get all issues with assignees different from user1 and user2". The result is that unassigned issues will not show up.

Likewise, the query below brings issues with labels that are different from "important".

project = "My Project" and labels != important 

Solution

All we have to do is add  is EMPTY with an or statement. Taking the examples from above:

assignee not in ("user1","user2") or assignee is EMPTY

In the labels example:

project = "My Project" and (labels != important or labels is EMPTY)



Last modified on Feb 2, 2023

Was this helpful?

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