JQL - Need filter excluding tickets with 2 labels but not when either label (or neither) is present

Enrico Sette August 15, 2022

Hi all,

I'm using JIRA as a bug database and and am assigning specific labels to our tickets, so I know when a bug has been fully crosschecked on all platforms in a certain language. I'd like to create a filter that only shows me the bugs that still need to be crosschecked in a specific language in any missing platform, but I've not found any solution yet (I'm not a JIRA expert).

For example, let's take the filter that an English tester would use. The labels used for English are the following (the other languages will use similar ones in the same bug, the difference will be in the language code at the beginning):

- ENplatformAchecked

- ENplatformBchecked

When the English tester has checked the bug in English on platform A, they add the label "ENplatformAchecked" to the bug. The same thing happens with the second label, after they have checked the same bug on platform B. Now, if a bug has both "ENplatformAchecked" and "ENplatformBchecked" among its labels, I'd like the filter not to show it, as that means that the bug has been fully crosschecked in English on both platforms and the tester does not need to check it again in that language.

However, if the bug has either one of these two labels or neither of them (but NOT both), I'd like the same filter to show it, as that means the English tester still has to check the bug in English on either platform A or B (or both).

I thought that the following filter would work, but it still shows me the bug when both labels are in:

status = "X" AND Component = "Y" AND (labels != ENplatformAchecked OR labels != ENplatformBchecked) order by created DESC

I think the issue is in the brackets or in the "OR", but I'm not entirely sure. Would you have any idea? As mentioned before, other labels will be added to the bug for the other languages, so the two labels above will not be the only ones in a bug.

Thank you for any help you can give!

2 answers

1 accepted

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 15, 2022

Hi Enrico - Welcome to the Atlassian Community!

Give this a try:

status = "X" AND Component = "Y" AND ((labels != ENplatformAchecked AND labels != ENplatformBchecked and labels is not empty) OR labels is empty)order by created DESC

Enrico Sette August 16, 2022

Hi John,

Thanks for your reply and for welcoming me! I've tried your suggestion, but it partially works. Here is what happens:

- When neither ENplatformAchecked nor ENplatformBchecked are present in the bug, the filter shows me the bug. That is perfect, as it means that the bug still has to be checked in English on both platform A and B.

- When either ENplatformAchecked or ENplatformBchecked is present (but not both at the same time), the filter does not show me the bug. This is incorrect, because I would still need to crosscheck the bug in the platform whose label is not in the bug, so I would need to see the bug in the filtered list.

- When both ENplatformAchecked and ENplatformBchecked are in the bug, the filter removes it. That is great, because that means the bug has been checked on both platforms, so I do not need to see it again.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 16, 2022

Oops - sorry about that. Try this:

status = "X" AND Component = "Y" AND ((labels != ENplatformAchecked AND labels != ENplatformBchecked and labels is not empty) OR (labels != ENplatformAchecked OR labels != ENplatformBchecked and labels is not empty) OR labels is empty)order by created DESC

Like Enrico Sette likes this
Enrico Sette August 17, 2022

Hi John,

This worked wonderfully! Thanks a lot, you deserve a statue!

Enrico

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 17, 2022

Haha, thank you, Enrico! I am glad it worked for you!!

0 votes
mauricio.groth
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.
August 15, 2022

Hi @Enrico Sette 

As you're on Jira Cloud, the correct answer is to get an app that provides JQL extensions you're looking for.

With standard JQL, you can only get a list of issues and export them to Excel for further processing. This works if you want to do a one-off analysis. If your use case is more dynamic than that, look beyond standard Jira.

Standard JQL doesn't easily allow it, but you can quickly find the results using our professional indexing service JQL Search Extensions

Firstly, you run this query in our app and save it as a filter.

issue in wildcardMatch("labels", "ENplatformAchecked") and issue in wildcardMatch("labels", "ENplatformBchecked") 

Captura de Tela 2022-08-15 às 9.15.59 AM.png 

And then, you run it like this:

filter != filtername and status = "X" AND Component = "Y" order by created DESC

With this, you will see all your issues that haven’t the labels with the 2 options at the same time.

Check out the documentation for more examples.
I hope this helps!
Maurício

Enrico Sette August 15, 2022

Hi Maurício,

Thanks for your quick reply! I'll suggest this to my client and check if they are ok with getting the app.

Kind regards,

Enrico

Suggest an answer

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

Atlassian Community Events