Forums

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

Complementary queries on inclusion and exclusion of a label does not sum to total (exclusion fails)

Harshit Gupta December 24, 2024

Say, I have some 6286 JIRA Tickets of some type (Test Case) in a project (MCAL)

image.png

When I search for matching labels, I get the right count (I know as I created only 14 of them)

image.png

But, this shall mean that 6286 - 14 = 6272 Issues do not have this one label which I want to exclude.

However, searching for them only yields ~1781 issues

image.png

Trying to negate the query with `... NOT labels = <label>`, `... labels NOT IN (<label>)`, `... NOT labels = <label>`, all of these have returned the same count of 1781 as shown.

I am on JIRA v9.12.13 release. Please check the case and suggest on what is wrong with the above was to search for the issues without a given label?

1 answer

1 accepted

2 votes
Answer accepted
Kseniia Trushnikova
Community Champion
December 24, 2024

Hi @Harshit Gupta,

Your JQL query does not include tickets with no labels.

Add "OR labels is EMPTY" to the JQL query:

project = MCAL and type = "Test Case" and (labels != LDRA_Automation OR labels is EMPTY)

 Let me know if it helps.

Harshit Gupta December 25, 2024

Hi @Kseniia Trushnikova

Thank you for your suggestion. As you have suggested, including Empty labels gives the correct remaining issue counts as 6272.
image.png

This is what I was expecting.

Thank You.

Like Kseniia Trushnikova likes this

Suggest an answer

Log in or Sign up to answer