It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I search for issues that do NOT have a certain label

Steve Slesinger Jun 05, 2012

I have tried various advanced searches and cannot get the syntax right. I want to look for all issues of certain status (for example, open or reopened or inprogress) but exclude any with a certain label (for example OnHold). Tried every kind of NOT but cannot get it to work. HELP please.

12 answers

1 accepted

60 votes
Answer accepted
Miroslav Atanasov Nov 06, 2012

had the same problem, solved it this way:

status in("open","reopened","inprogress") and (labels not in("OnHold") or labels is EMPTY)

Hieu Le Trung Oct 25, 2013

It works for me. Thanks,

Like # people like this
Tim van Cann Feb 05, 2014

Works perfectly

Joshua Wold Mar 12, 2014

Worked! Thanks.

Brendan Andrews Jul 14, 2014

The case this doesn't resolve is for issues with any other labels.

In JIRA on demand this query returns the same issues as a query returning only issues with no labels. The inclusion of not in ("XXXX") makes no difference.

BłażejO Aug 04, 2014

You saved my day :)

Aneece Yazdani May 08, 2015

This works for me just fine on JIRA v6.4.1. I didn't think to consider EMPTY like a NULL value that requires an explicit comparison. Thanks!

Tim Enloe Aug 26, 2015

Perfect, just what I was looking for.

Barry Gausden Oct 01, 2015

Nice. Many thanks.

Mike McGowan Aug 09, 2016

Words cannot express my thanks!

Mahender Reddy Yasa Feb 16, 2017

Really saved my day thanks a lot🙂

Jennifer Zou May 09, 2017

It works like a dream!!!!! Thank you very much!!!!!

Tom Vian Jul 06, 2017

Nice.  thanks

Tom Corcoran Aug 24, 2017

Brilliant!

Flying High Dec 07, 2017

Top stuff.  Thanks Miroslav

Amir Weiss Apr 07, 2018

Thanks!

Karin Schütt Jul 02, 2018

Great help. Thanks

Melissa Canterbury I'm New Here Jan 18, 2019

THANK YOU!!!!!!

Martin Delgado Mar 19, 2019

Big help here

7 votes
Nigel Johnson Mar 06, 2015

I have issues logged that have a "DEMO" label. operationally I want to filter these out, prety much as the OP. There wasn't a proper anser above, a couple of fragments so I eventually came up with:

    and (labels is empty or (labels is not empty and labels not in (DEMO)))

This means if it's empty, list it. If it has any label, filter out issues that have the DEMO label. Hope that clarifies things.

Nice !

Heather Laurence Apr 25, 2016

You are my hero! 

kathleen Walsh Dec 19, 2017

Unfortunately this doesn't seem to work for me.

the query is slightly more complicated:

project in (WIN) AND issuetype in (Epic, Initiative) AND status not in (Delivered, Closed, Cancelled) AND (labels not in ("Prime-Backlog") OR labels is EMPTY)

 

I get the same number of issues back with or without the last AND clause and get labels I don't want.

Undead2k Aug 28, 2018

Signed up just to say thank you and upvote. Helped me with my issue! Nigel Johnson!

Jennifer Severin I'm New Here Jun 05, 2019

Thank you.  This helped me with my issue!  

1 vote
Jobin Kuruvilla [Go2Group] Community Leader Jun 06, 2012

Try

status in ("open","reopened","inprogress") and labels not in ("OnHold")

Steve Slesinger Jun 06, 2012

I tried adding a screen shot but it isn't showing...I'll try converting to JPG

Steve Slesinger Jun 06, 2012

It takes it but says no issues found, and there ARE issues with that label!!!

Steve Slesinger Jun 06, 2012

Notice, I can use "in" to find ones with the label, and it works, but the "not in" returns no entries, when there should be LOTS.

Jobin Kuruvilla [Go2Group] Community Leader Jun 06, 2012

When you say NOT in, it will find issues without that label but in the mentioned statuses. Are you saying you have issues in those states without the label?

Steve Slesinger Jun 06, 2012

I added the picture, but cannot see the attachment???

Jobin Kuruvilla [Go2Group] Community Leader Jun 06, 2012

I would raise the issue with Atlassian support.

Steve Slesinger Jun 06, 2012

PS. In Progress is two words, I fixed that.... still doesn't work

Steve Slesinger Jun 06, 2012

Correct. I have many issues in those statuses without that label. They either have NO label, or some other label, but the query returns NO entries whatsoever.

1 vote
thomas tulinsky May 27, 2013

May be caused by the problem I report in

https://answers.atlassian.com/questions/174362/search-with-not-requires-and-contrary-to-documentation

Seems to search for A and not B, you must say

A AND NOT B

not

A NOT B

which the documentation says.

0 votes
Alexander Fedtke Jun 19, 2013

Hi,

How do i get all issues without a specifc label xy

the query

project = A AND not labels = xy

is not workiing

can anyone help?

Michael Knight Atlassian Team Jun 20, 2013

Maybe try

project = A AND labels NOT IN (xy)

0 votes
Alexander Fedtke Jun 20, 2013

Hi

tried this as well without sucess.

I got zero results back even if i have issues from that project without label = xy

I am using JIRA 5.2.1

Any more suggestions?

Michael Knight Atlassian Team Jun 20, 2013

Try

project = A AND (labels NOT IN (xy) OR labels IS EMPTY)

It behaves like SQL's NULL, where any comparison involving NULL (except for IS NULL) is false.

Like Matt Tarris likes this
0 votes
Nitram Jun 20, 2013

Hi

Check this, may be usefull for you,

https://answers.atlassian.com/questions/73065/labels-does-not-contain-is-not-working

Hope this helps.

0 votes
Alexander Fedtke Jun 20, 2013

Great works you both made my day!

0 votes

Thanks for your help smile This helped me with a query I was trying to get to work.

status in ("current sprint") AND (labels not in ("Tasking") OR labels is EMPTY)

0 votes
Mahender Reddy Yasa Feb 16, 2017

Really saved my day thanks a lot☺

0 votes
Peter Jones Aug 08, 2018

That helped a lot, thanks

Pete

0 votes
Jordi Federico Aug 09, 2018

I had same issue. Had difficulties to filter Labels. I am using version 7.5.3

(labels not in (X,Y) or labels is EMPTY ) and status in (Backlog, Analysis).

Adding the "labels is empty" helped.

Tim McGrath Nov 27, 2018

Problem is correctly identified above by Thomas Tulinksy. Beware that adding "labels is empty" appears to help (i.e. you suddenly see results, hurrrah) but does not show any issue that has a different label (e.g. "Z")

To overcome it, you must use the AND NOT exactly as Thomas described.

Status in (Backlog, Analysis) AND (NOT labels in (X,Y) OR labels is EMPTY) ORDER BY LABELS ASC

Like Bruno De Mauro likes this

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

861 views 12 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you