Filter is not working

Cliff Perea July 7, 2021

I am using the following filter to bring up bug issues that my team has not reviewed. When a bug is reviewed we place the word "Triaged" in the labels field, but for some reason this filter is not bringing up all the bugs that have not been Triaged. I am hoping someone can help me with this. 

project = project AND issuetype = Bug AND status = "Dev Backlog" AND labels != Triaged ORDER BY created DESC

3 answers

3 accepted

4 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 7, 2021

Hello @Cliff Perea 

 

Regarding the Labels field, what are the possible scenarios for it?

1. An issue has no values in the Labels field.

2. An issue has only the value "Triaged" in the Labels field.

3. An issue has the value "Triaged" in the Labels field, plus 1..n other values in that field

4. An issue has 1..n values in the Labels field and none of those values is "Triaged".

 

You want to get the issues that are in category 1 and 4, right?

 

Including "labels is EMPTY" gets you category 1 issues.

To get all the issues in category 4, you need a condition that will exclude the issues that have "Triaged" in the Labels field:
Labels not in (Triaged)

 

You need to combine those two conditions to get issues that fall within either one of the conditions:
(Labels is empty or Labels not in (Triaged))

 

Combine this with the rest of your conditions:

project = project AND issuetype = Bug AND status = "Dev Backlog" AND (Labels is empty or Labels not in (Triaged))

If this is not returning the expected data, please provide a screen image of the jql statement in the Search screen, and a screen image (including the project, issue type, and status, and Labels values) for an issue you think should be in the results set but that is not in the results set.

 

If you use just the condition

Labels not in (Triaged)

...then you will get only issues that have at least 1 value in the Labels field and none of the values is "Triaged". This condition will NOT return issues that have no values at all in the Labels field.

Cliff Perea July 8, 2021

Hello Trudy, this did the trick. Thank you so much for the explanation, I never really thought of it this way, but it makes complete sense. Appreciate your help! 

3 votes
Answer accepted
Bill Sheboy
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.
July 7, 2021

Hi @Cliff Perea -- Welcome to the Atlassian Community!

Do you have any issues with other labels, or no labels?  If so, maybe try this adjustment:

project = projectName
AND issuetype = Bug
AND status = "Dev Backlog"
AND (labels NOT IN (Triaged) OR labels IS EMPTY)
ORDER BY created DESC

Best regards,
Bill

Cliff Perea July 7, 2021

I have not tried excluding any other labels, but let me try this, thank you for responding so quickly. 

Like Bill Sheboy likes this
Cliff Perea July 7, 2021

This did not work

Bill Sheboy
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.
July 7, 2021

To clarify, what did not work?  Were issues returned that you did not expect, or are there issues missing which you expected, or both?

When diagnosing a query it helps to look at specific example issues and try to understand why they are returned (or not), and then see what is different about them.  That will help to adjust the query.

Or, uncover an actual defect in JQL to submit to Atlassian.

Cliff Perea July 7, 2021

No issues came up with the suggestions you provided. 

Cliff Perea July 7, 2021

I am curious, if the != doesn't work with the labels field, but I also tried putting Triaged in the component field and I still didn't get all of the bugs that didn't have Triaged in the filed to come up. 

Bill Sheboy
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.
July 7, 2021

Cliff, would you please post the exact query you are trying which checks the labels field?  Thanks!

Cliff Perea July 7, 2021

project = project AND issuetype = Bug AND status = "Dev Backlog" AND labels NOT IN Triaged ORDER BY created DESC

I put in the new information you provided and I didn't get any issues to come up at all when I used this. 

Cliff Perea July 8, 2021

Thanks again Bill for your help!

Like Bill Sheboy likes this
2 votes
Answer accepted
Stooz The Stoozer
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.
July 8, 2021

it is likely to be the above, a combination of 'is empty'. But can I suggest an alternative which is to have triaged as a step in the workflow?

Labels are tricky as they are manually entered and open to human error, spelling etc.

There are also weird occurrences in labels where capitilasiation is considered different and also the same that unnerves me. 

Cliff Perea July 8, 2021

Yes, this was discussed, but decided by the team to not change the workflow. The information Trudy provided me above did the trick. Thanks for your response!

Stooz The Stoozer
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.
July 8, 2021

Glad you got the filter working. I was going to also suggest a new custom tick box field for triaged and that is easy to filter on as well 

Like Cliff Perea likes this

Suggest an answer

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

Atlassian Community Events