Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JQL labels not in (LabelName)

Jeff Santos December 18, 2019

Hi,

Im trying to save a filter with a JQL of all issues thah DO NOT contain a certain label.

However, I realized it simply doesn't work.

when I search :

labels == Recorrente  

or 

labels in (Recorrente) 

It works fine.

But if I try to do the opposite, it doesn't work:

labels != Recorrente 

labels not in (Recorrente)

Any ideas about how can I workaround it?

Thanks! 

2 answers

1 accepted

17 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 18, 2019

Hi @Jeff Santos ,

it seems to me, that the problem is, that you have forgotten to add the issues, which have no labels.

Please, try this:

labels is EMPTY OR labels not in (Recorrente)
Jeff Santos December 19, 2019

HI @Hana Kučerová ,

It worked fine. 

I really thought that using != would make it necessary to specify that I wanted issues with empty labels.

Thank you for the help!

Like # people like this
CGIschabotbeaulieu September 8, 2021

Works - Thanks :)

Like Eric Willig likes this
Andy Finley January 19, 2022

This isn't working for me and I have no idea why.  I've found no less than three different versions of this question and all of them provide the same answer.  I need to find issues that either have Labels empty or have a Label that is not THU.  The logic provided here, and elsewhere isn't working:

project = "Physicians Organization Service Desk" AND issuetype = Change AND status not in (Closed, Resolved) AND assignee in membersOf("Epic PB Application") AND status = "Waiting for approval" AND (labels is EMPTY or labels not in (THU))

All I get in response are issues where Labels is empty.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2022

Hi @Andy Finley ,

I don't see anything wrong with your JQL. As your JQL is complex, I would recommend you start debugging like this:

  1. try JQL: 
    labels is EMPTY or labels not in (THU)
    and see, which issues you get
  2. if these issues are correct, then add another paramater to JQL:
    project = "Physicians Organization Service Desk" AND (labels is EMPTY or labels not in (THU))
    and so on...
Like # people like this
Dusan Sancanin February 7, 2022

The results show all tasks, from all the previous sprints although I define the sprint name
"AND sprint = sprint ID"

 

Any idea why?

Matt Bradley July 15, 2022

Hey there @Andy Finley I had the same issue as you and got this to work by using additional brackets. To essentially run the first part of the query first before the label aspects. 

So for me (labels is EMPTY OR labels not in (cookies-blocker, cookies-mvp)) And filter=99501

I'm also using a saved query for ease. 

Thanks 

Like # people like this
rstimson October 10, 2022

It works!

To me, it would more sense if labels not in (x) returned the opposite of labels in (x). I don't think specifying labels = EMPTY should be necessary in this case.

Like # people like this
0 votes
Keith Robertson August 28, 2023

Instead of

labels != Recurrent

labels not in (Recurrent, Irreproducible)

use

# Select ticket if missing the named label.
NOT (labels = Recurrent)

# Select ticket if missing ANY of the named labels.
NOT (labels = Recurrent AND labels = Irreproducible)

# Select ticket only if missing ALL of the named labels.
NOT (labels in (Recurrent, Irreproducible))

These avoid having to check whether labels IS EMPTY.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events