Forums

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

How use the "labels" field in a JQL query?

Radu Butucelea
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 18, 2020

Dear all,

 

I am trying to run a JQL query that looks somehting along the lines of:

project = XYZ AND component = "XYZ" AND (summary ~ XYZ OR summary ~ XYZ) AND labels != ComponentReview

The problem is that this query returns 0 results even though there are plenty of JIRA issues that do not have the label "ComponentReview" but satisfy all of the other conditions.

The intriguing part is that if I run the same query with "=" instead of "!=" I get all the issues that have the label so I am really wondering why does the "!=" operator does not work in this case? 

 

Many thanks

1 answer

1 accepted

11 votes
Answer accepted
Payne
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.
February 18, 2020

Using labels != ComponentReview will return issues that have one or more labels, none of which are ComponentReview; it will not return issues that have no labels. Try the following to include those as well:

project = XYZ AND component = "XYZ" AND (summary ~ XYZ OR summary ~ XYZ) AND (labels is empty or labels != ComponentReview)

Chris
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!
March 15, 2023

Worked perfectly. Thanks! 

Like # people like this

Suggest an answer

Log in or Sign up to answer