JQL search using a label

This is a very simple query that just doesn't seem to work in Jira.  Any help as to why these searches would not return a complete list would be appreciated.

I've used the following two queries and they work fine by selecting items from a list: 

labels != Group_Testing - returns hundreds of issues 

fixVersion = 2016.13 -  returns 30+ issues

 

The following queries all return a single issue:

labels != Group_Testing AND fixVersion = 2016.13

fixVersion = 2016.13 AND labels != Group_Testing

fixVersion = "2016.13" AND (labels not in(Group_Testing))

fixVersion = 2016.13 AND labels not in (Group_Testing)

fixVersion = 2016.13 AND labels !~ Group_Testing (Not supported which is kind of annoying)

3 answers

2 votes

I think this is down to the difference between "label is not" and "label is empty".

When an issue has no labels, it does not pass the test "label is not", because there's nothing to compare.  I answered a question that was similar earlier, and blamed human language structures - most of our languages are unclear on the difference between null, empty and filled, and they discourage us from being clear enough for the computers to understand us.

The short version - try adding "labels is empty" to the "nots".

(labels != Group_Testing OR labels is empty) AND fixVersion = 2016.13

(fixVersion = 2016.13 OR labels is empty) AND labels != Group_Testing

and so-on

 

This is a horrible implementation.  labels != Group_Testing should return anything that doesn't have a group testing label

(labels != Group_Testing OR labels is empty) AND fixVersion = 2016.13 will return more results but will not return all results.  

Let us just say I have multiple labels (which I do).  I'd have to do the following query

(labels != Group_Testing OR labels is empty OR labels = projectx OR labels = projecty) AND fixVersion = 2016.13

This may get a few more issues but not all the issues.  Lets say a project doesn't have a label field in the JIRA implementation.  The fix version can be found but "labels is empty" won't return project tickets that don't have a label field.  I think I'm in trouble because I don't see a way to add "field doesn't exist" to my query.  It's what I'm stuck with.  I'll probably have to add the label field to all instances.  I still think the JIRA implementation of this search is painful at best.

It's not the implementation, it's the problem that humans are fuzzy thinkers.  Fuzzy thinking is imaginative, creative and inventive.  But it's unclear and imprecise, and utterly useless for computers.

You're assuming you don't need to explain the exact query to the computer, but computers can't read your mind (yet).  So you need to be precise.

The implementation does work for "field does not exist".  That is not quite technically the same as "field has nothing in it", but the result does work.  "is empty" will fetch both "empty" and "field isn't even there" results.

I thank you for the first answer but really?  You can call the sky green all you like but if it looks blue to me than it's blue....8-)  is empty is not gathering "field isn't there" for me.  Every bug that doesn't display for me is missing the label field in the field configuration.  All the items with a label field work fine with the != and is empty query.  There may be another term besides is empty that might find it but is empty is not working for our configuration.  

 

 

The problem is that the implementation is correct and accurate.  Hard for humans to intuit, yes, but it's right.

Regardless of what Nic says if anyone else is seeing a problem with "labels is empty" not working you may be doing nothing wrong.  I've administrated a number of defect tracking systems and normally Nic would be right that "labels is empty" should work here.  Perform a search using another field where values are always present and make sure the labels field displays in the query results.  In the query result you will see a blank value in the labels field instead of "None".  The "None" values will return on a "labels is empty" query.  The items with no field value displayed (blank) will not return on a "labels is empty" query.  For me these items are all tasks so this issue may be only related to tasks not displaying in the query results for the labels field. 

0 vote

Why do you think it is not working? Are there other issues with label "Group_Testing" with fixVersion as "2016.13"?

Looks like there is only one issue satisfying both conditions?

It's the != and Not In items that are not working.  I can do a search of labels = Group_Testing AND fixVersion = 2016.13 which returns 12 issues.  You would think changing = to != or Not in would then remove those 12 items and leave the remaining 23 but it does not.

 

Ah. As Nic mentioned, you need to also search for issues that doesn't have a label. "!=" searches for issues with labels, but not matching to given label, only.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,329 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot