It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Why is this JQL filtering out issues without a label?

I have the following filter:

 

(assignee = currentUser() OR Developer = currentUser()) AND assignee = currentUser() AND status not in (Closed, Done) AND project not in (Loyalty, JIRA) ORDER BY fixVersion ASC, status ASC, priority DESC

This works correctly. I now want to add a clause to exclude tickets with a certain label, so I did this:

 

(assignee = currentUser() OR Developer = currentUser()) AND assignee = currentUser() AND status not in (Closed, Done) AND project not in (Loyalty, JIRA) AND labels not in (jira-dev-test) ORDER BY fixVersion ASC, status ASC, priority DESC

 

Now it's filtering out issues with that label, but also filtering out all issues without a label. What am I doing wrong? 

2 answers

1 accepted

1 vote
Answer accepted
nic Community Leader Apr 14, 2016

It's because most human languages are fuzzy and imprecise, and we translate badly when we're talking to the computers.

You have three possibilities here:

  • No labels set
  • Label jira-dev-test is present
  • Labels are present (like penguin and flibble) but not jira-dev-test

Your clause is precise, but expressed in English, it says "look at the labels and tell me when jira-dev-test is not there".  If the issue has no labels, there's nothing to look at.  So it can't tell you that jira-dev-test is not there.  You need to catch the "no label" fact somehow, and the nice clear way to do it is:

 AND (labels not in (jira-dev-test) or labels is empty)

Add "Labels is EMPTY" clause as well.

(assignee = currentUser() OR Developer = currentUser()) AND assignee = currentUser() AND status not in (Closed, Done) AND project not in (Loyalty, JIRA) AND (labels is EMPTY OR labels not in (jira-dev-test)) ORDER BY fixVersion ASC, status ASC, priority DESC

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

864 views 7 0
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you