JQL for labels does not return correct results

I have a query that returns 25 issues. Out of these 25 issues, 2 have label xxx.

I add to my JQL, AND Labels not in ("xxx") and I get 10 issues. I replace it with AND Labels in ("xxx") and I get 2 issues. Something here is wrong. Any ideas?

thanks

9 answers

1 accepted

I guess out of the 25 issues 13 have no labels at all. That would explain the two other result sets (2 and 10).

Note: label not in (xxx) will display all issues where the label is different from xxx and not empty

Any way I can capture the 23 tickets that I am looking for?

yes, use

AND (Labels not in ("xxx") or labels is EMPTY)

edit: sorry, this is how it should work

So, your query basically excludes the items which does not contain any label.

 

You can try this instead: 

(labels != "LBL1" OR labels = null)

labels =null will not work, you need to use labels is empty to capture those issues with no label

0 vote

I can't see the difference between your queries or how you are entering them, it just says "and labels in xxx" twice.

One is with "NOT".
0 vote
Joe Wai Tye Atlassian Team Nov 10, 2013
Hey there, have you tried re-indexing? Quite a lot of search-related issues could be caused by the index. Please try to perform a complete re-index, and see if the problem persists
0 vote

I suspect we might want to see the definitions of both queries in full. It can be important where and how a clause is added to a query. (If not, then re-indexing is the next step)

0 vote

Sorry, obviously not enough coffee this morning.

Please Re-index.

if not he can do indexing through the groovy code for issues in the filter(25 issues) that he has mentioned.

it wont take much time I guess.

You don't know that indexing is the problem yet. It could be the structure of the query.

the JQL is : project = projectname AND resolution = Unresolved AND fixVersion = EMPTY AND labels in ("labelname")

Ah, good. Sort of. That query is not structured in a way that might be causing a problem. Straight clauses joined by "and"s are almost always straightforward.

So, now we need to ask you to test the effects of re-indexing

As per my understanding *[labels = null]* and [labels is EMPTY] doesn't makes any difference in results. I have tested with both the options and got the same result.

true, unless someone adds a label named "null"

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

82 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you