Forums

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

JQL - Filter to exclude specific labels? 🙏

Nick
Contributor
September 14, 2023

Hi,

I have the following query and wish to add a filter to exclude 2x specific labels from the view.

Let's call the two labels "label1" and "label2".

So I want the query to return all issues that match the rest of the query, including EMPTY, but EXCLUDING ANY issues assigned either "label1" and "label2"

This is my query so far:

project IN ("Project X") AND type IN (Task,Story) AND status IN ("To Be Refined","In Refine") AND component in ("Launchpad") ORDER BY Rank

Any ideas?

 

Thanks,

1 answer

1 accepted

1 vote
Answer accepted
David Blank
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.
September 14, 2023 edited

HI @Nick !

 

Could the following work?

labels NOT IN (label1, label2)

Like:

project IN ("Project X") AND type IN (Task,Story) AND status IN ("To Be Refined","In Refine") AND component in ("Launchpad") AND labels NOT IN (label1, label2) ORDER BY Rank

 

 

Nick
Contributor
September 15, 2023 edited

HI @David Blank - Thanks for your suggestion, but unfortunately, no such luck.

Here's my query after adjusting it to consider your suggestion:

project in ("Project1") AND type in (Task, Story) AND status in ("To Be Refined", "In Refine") AND component in (Launchpad) AND labels NOT IN (Label1, Label2) ORDER BY Rank

 The query seems to be successfully excluding "label1" and "label2", however, it is ignoring (i.e. not returning) issues where the label field is empty...

In other words, the query is only returning issues that have labels, where the labels are not "label1" or "label2"..

David Blank
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.
September 15, 2023

Hi @Nick could you try adding: OR labels IS EMPTY?

 

You will want to put both of your labels filters in parenthesis I think if you do it that way.

 

Like: 

project in ("Project1") AND type in (Task, Story) AND status in ("To Be Refined", "In Refine") AND component in (Launchpad) AND (labels NOT IN (Label1, Label2) OR labels IS EMPTY) ORDER BY Rank
Like Richard Ramsden likes this
Nick
Contributor
September 15, 2023

Nailed it! Thank you so much!!

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events