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

0 votes
Derek Fields _RightStar_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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

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