How to get the filter working like expected?

Stefan January 20, 2021

Hi,

we have the following filter:

project = XYZ AND issuetype = Bug AND fixVersion = XY-2021-nn OR labels = Bugs2021-nn ORDER BY issuetype ASC, key DESC

Now we would like to exclude some bugs. We tried to add for example

AND affectedVersion != "not-for-buglist"

The bug that has this affectedVersion was excluded, but also all bugs that has the affectedVersion not set were excluded.

How can we just exclude the bugs from the list that has affectedVersion set to "not-for-buglist"?

Regards
Stefan

1 answer

1 accepted

1 vote
Answer accepted
Radek Dostál
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.
January 20, 2021
project = XYZ AND issuetype = Bug AND (fixVersion = XY-2021-nn OR labels = Bugs2021-nn) and (affectedVersion is EMPTY or affectedVersion != "not-for-buglist") ORDER BY issuetype ASC, key DESC

Maybe you were missing the "is empty" part? Because contrary to popular expectation just saying a value != X will make Jira ignore all issues where there is a null value, it will just filter out anything having a value, just not X.

 

Also added extra brackets at the beginning - unless you intent to filter across the whole instance.

With the OR it will just do 2 searches really, left part, right part, then join them together. This would mean that in your original query you were filtering across the whole instance.

Stefan January 20, 2021

Thanks! Now I understand why it did not work. And I changed the filter and now it is working fine.

Regards
Stefan

Suggest an answer

Log in or Sign up to answer