Forums

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

Filter Query to exclude issues with a particular label

Franziska Mast June 27, 2023

Hi there,

I am using a filter for a board (software project) to display issues. Now I would like to filter the issues in that board to exclude all issues that have a particular label called "Hardware" and "Innovation" - the result should be that I will see all issues except for those that have the label "Hardware" and/or "Innovation"

So in my example I have 20 issues, 11 of the issues use label "Hardware", 3 use "Innovation Management". In my board I want to see only those issues that use either Hardware nor Innovation

I tried several times, e.g. with labels !=Hardware or labels not in (Hardware), however the result was not what I expected

 

Can anyone advice please?

Thanks a lot!

 

2 answers

2 accepted

1 vote
Answer accepted
Mohamed Benziane
Community Champion
June 27, 2023

Hi,

Can you try

labels not in (hardware, innovation)

0 votes
Answer accepted
Trudy Claspill
Community Champion
June 27, 2023

Hello @Franziska Mast 

Welcome to the Atlassian community!

How exactly are the results not what you expected?

Are there issues missing that you think should be included? Why do you think they should be included?

Are there issues present that you think should be excluded? Why do you think they should be excluded?

Franziska Mast June 27, 2023

Thanks for replying. 


I have in total 795 issues in my list. 257 of those issues (issue type user story, sub-taks, epic) use the label "Hardware" in the field "Labels". 

However, when I want to exclude those 257 issues that use label "Hardware" from the filter the result only shows 96 issues.  I would expect that the list shows 538 issues (795-257). 

I am using the following filter: Project = "xx" AND labels not in (Hardware) order by created DESC / Project = "xx" AND labels != Hardware order by created DESC 

Trudy Claspill
Community Champion
June 28, 2023

Do the missing issues have any label value at all?

When you have a criteria to check the value of a multi-select field like Labels, the criteria can be evaluated only for instances of that field that actually contain a value. Jira can't compare the value "Hardware" to a field that contains no value.

If you want to include the issues that have no value in Labels then your criteria needs to be one of these:

Project = "xx" AND (labels not in (Hardware) or labels is empty) order by created DESC

Project = "xx" AND (labels != Hardware or labels is empty)

Like # people like this
Franziska Mast June 28, 2023

The 538 issues that I would expect to see as a result have either another label or none. 

If I try "Project = "xx" AND (labels not in (Hardware) or labels is empty)" I get even more issues (1000+). Jira then also includes issues from other projects, event though I have specified the Project = "xx" in the filter.


Trudy Claspill
Community Champion
June 29, 2023

Please show a screen image of your filter so that we can confirm there are no typos. There is no way that this query should return issues from other projects unless the parentheses are not correct.

Franziska Mast July 3, 2023

There was atipo .. ufghh! Thanks for your support and patience with this ^^. 
I got the expected result. 

One question regarding the filter below: does this filter also include issues that have either no label at all or issues that are using a different label than Hardware (e.g. Solutions)? 
Bildschirmfoto 2023-07-03 um 09.17.54.png

Trudy Claspill
Community Champion
July 3, 2023

If the Labels field has no value at all, it will be included.

If the Labels field has "Hardware", then it will be excluded, regardless of whether or not it has other values in it.

If the Labels field has other values in it, and "Hardware" is not one of those values, it will be included.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events