Forums

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

JQL for "not in epic" OR "doesn't have label"

Spyder McHenry
Contributor
August 3, 2018

I want to filter out issues that are not in a specific epic or don't have a specific label with the same name as the epic. 

I'm trying to achieve this with this JQL: 
"Epic Link"!="BearHug" OR labels not in (BearHug)

That filter filters out a bunch of issues that don't meet that logic. 

When I want to collect the issues into my view, I use this JQL:
"Epic Link"="BearHug" OR labels in (BearHug) 

That filter filters out everything but issues within the Epic "BearHug" and also issues that have the label "BearHug". I have also tried just adding a "!" in from of the second filter like this:
!("Epic Link"="BearHug" OR labels in (BearHug))

That filter produces a strange and small subset of all issues.

 

What JQL will achieve my goal of filtering out all issues that either have a label of "BearHug" or are in the Epic called "BearHug" ??

Help is much appreciated!

 

2 answers

1 accepted

15 votes
Answer accepted
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 3, 2018 edited

When searching for the non-existance of something you also have to account for the case of the value being EMPTY which will not be included if you simply do a not in or != operation.

 

"Issues without the label "BearHug"

labels is EMPTY or labels != "BearHug"

 

"Issues not assigned to Epic BearHug"

"Epic Link" is EMPTY or "Epic Link"!="BearHug"

 

"Issues not assigned to Epic BearHug and dont have a BearHug label"

(labels is EMPTY or labels != "BearHug") and ("Epic Link" is EMPTY or "Epic Link"!="BearHug")

 Atlassian should just flip it and default to including EMPTY as part of != operators for the sake of simplifying the VAST majority of JQL's in the wild

Spyder McHenry
Contributor
August 3, 2018

Thanks a lot! That got it!

0 votes
John Schram August 6, 2023

Why isn't this just a bug? Logically it's wrong, and it feels like Atlassian is unwilling to fix it because they're afraid it will break Jira queries across the world so they just let it be wrong. After all this is JQL not SQL, it doesn't "have to" have special handling for NULL

Suggest an answer

Log in or Sign up to answer