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

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.

10 answers

1 accepted

had the same problem, solved it this way:

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

It works for me. Thanks,

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.

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!

Perfect, just what I was looking for.

Nice. Many thanks.

Words cannot express my thanks!

Really saved my day thanks a lot🙂

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

Top stuff.  Thanks Miroslav

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.

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.

0 votes

Try

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

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

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

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.

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?

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

I would raise the issue with Atlassian support.

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

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.

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.

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?

Maybe try

project = A AND labels NOT IN (xy)

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?

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.

Great works you both made my day!

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)

Really saved my day thanks a lot☺

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,781 views 11 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot