Forums

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

Exclude bugs with a particular label but not all bugs

Maria.Trofimchuk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 21, 2025

Hi, 

I'm struggling with the following requirement:

I need to exclude the bugs with UAT label from issues of a particular project (for using the filter in timesheets).

However, I need bugs without UAT label included (as well as bugs with empty labels). 

And I need other issue types with UAT label included. 

 

I'm trying several options, e.g. 

project = "XXX" AND NOT (labels =UAT AND issuetype=Bug) AND(labels Is EMPTY) ORDER BY issuetype ASC

It returns only 2 bugs with 1 label "security". Other issues with UAT label are included. 

Could anyone help me with it?

 

1 answer

1 accepted

1 vote
Answer accepted
Derek Fields (RightStar)
Community Champion
February 21, 2025

@Maria.Trofimchuk Welcome to the community.

The JQL that you are looking for is 

project = "XXX" AND (NOT (labels =UAT AND issuetype=Bug) OR (labels Is EMPTY)) ORDER BY issuetype ASC

This returns all of the issues in project XXX where the issue is either

* Not a Bug with the label UAT, or

* An issue that has no labels at all

You could also write this as 

project = "XXX" AND ((labels is EMPTY AND issuetype=Bug) OR (issueType not in (Bug))) ORDER BY issuetype ASC

Both should return the same results

Maria.Trofimchuk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2025

Hi Derek,

Thanks a lot for your help!

It worked.

Suggest an answer

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

Atlassian Community Events