Bug: Adding *not* to label search returns 0 rather than # issues not including the label

boardtc
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.
April 30, 2012

Has anyone else a problem with this?

Doing a simple search for a given project, fixVerison and assignne:

project = XXX AND assignee = YYY AND fixVersion = ZZZ

returns 19 issues, some with labels.

I can refine this search to return the ones using a certain label

project = XXX AND assignee = YYY AND fixVersion = ZZZ and labels in (AAA)

returns 13 issues. If I try and find the ones which do not have that label

project = XXX AND assignee = YYY AND fixVersion = ZZZ and labels not in (AAA)

I get 0 issues returned rather than 7.

2 answers

1 accepted

1 vote
Answer accepted
Harry Chan
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 27, 2012

AND (labels not in (AAA) OR labels is empty)

Is what you need. Some don't have labels, aka is empty.

To be clear: there are 3 cases:

1. is IN

2. is NOT IN

3. is EMPTY

Empty isn't 1 or 2. That's what's causing the difference.

boardtc
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 27, 2012

Harry, I guess my editing the title bummed this JIRA. I just added an answer to find yours!

Thanks for the clarification, I don't believe the empty case was the issue for me here, but without JIRA 4 I can't be sure. For the example given the details had chnaged and the not returned one for me (rather than the former 7). There were 2 jiras with empty labels out of the 19.

Harry Chan
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 27, 2012

I tried

project = "CONF" AND fixversion = "4.2" AND (labels in ("performance") OR labels not in ("performance"))

in jira.atlassian.com - 5.1.3 and this only returned about half the results. However, if I do:

project = "CONF" AND fixversion = "4.2" AND (labels in ("performance") OR labels not in ("performance") OR labels is empty)

It returns all the results. Hm.

boardtc
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.
October 3, 2012

Harry, I just came across this problem again with another query and your tip

AND (labels not in (AAA) OR labels is empty)

is the solution!!

0 votes
boardtc
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 27, 2012

I could not reproduce this in JIRA 5.0

Suggest an answer

Log in or Sign up to answer