Find issues with specific SLA field beeing empty


Is there a way to create a JQL matching issues where a certain SLA field is empty ?

The only operators I found where numeric ones (=, <, >, ...) but I couldn't find any "is empty" operator for example.

It's JSD / JIRA 6.3.15 , but I wonder if this is possible with latest versions.


Thanks in advance for your help,

3 answers

1 accepted

1 vote
Answer accepted

My co-worker asked this question and I thought it was simple. I was so wrong! I couldn't let it go and spent some time investigating this question of "find not breached".

Base set

project = MYPROJECT

100 issues

SLA is breached

project = MYPROJECT AND "My SLA" = breached()

5 issues

SLA is not breached

project = MYPROJECT AND "My SLA" != breached()

50 issues

Hrm, I would think that issues where the SLA has not been run would be included in the results. That's now how Jira typically works though. Usually in JQL, "!=" does not include issues where what you're searching for is EMPTY e.g. null. This search only returns issues that have the SLA field populated and the SLA is breached. It leaves out the ones that have no value for this SLA at all.

Attempts to find SLA is empty / unset / null

You might think we could invert the "= breached()" part to find the empties, but nope, that yields that same answer as above.

project = MYPROJECT AND NOT ("My SLA" = breached())

50 issues

So just to drive this home, using these SLA functions will only show us issues that have run that SLA, breach or not. Here is how to get all issues that have run this SLA.

project = MYPROJECT AND ("My SLA" = breached() OR "My SLA" != breached())

55 issues

We can't invert this either... JQL parses the query, flattens it out, and comes up with 0 issues just like it did before. For JQL, there aren't any issues that have run this SLA which are not either breached or not breached. My head hurts!

project = MYPROJECT AND NOT ("My SLA" = breached() OR "My SLA" != breached())

0 issues

The Solution

We'll take advantage of another JQL quirk to solve this. When Jira evaluates saved filters it doesn't fetch it and flatten out the query like it does above. It just gets all issues from the saved filter and compares it to the rest of the query result. So if we save "Time to response" = breached() in a filter, we can use it to get everything else that doesn't match.

Save a filter named "My SLA Not Empty" with this JQL:
project = MYPROJECT AND "My SLA" = breached() OR "My SLA" != breached()

55 issues

Now we can reference this filter and invert it to exclude issues that DO have the SLA.

project = MYPROJECT AND filter != "My SLA Not Empty"

45 issues

We have a winner!

There's a Feature Suggestion for this to make it easier. Vote it up!

One thing to watch out for is that in really large instances referencing filters in this way (sub queries) can create excessive memory pressure. Jira retrieves all issues that match the referenced filter, retrieves the issues from the rest of the JQL, and processes them in memory to return the desired result set. Check how many issues are returned by your saved "SLA Not Empty" filter. If it is many thousands, consider narrowing it down with created > DATE or other criteria to reduce the number of issues to compare.

Accepting your solution since it seems to work, but I'd rather have the JSDSERVER-4650 for a clean way to solve this :-)


Just tried in 3.2.7 and 3.3.0 and it's not possible in later releases either. Same operator options available.



This operation was intentionally not added as from our knowledge of it, the SLA should be based on what was configured by the project Admin, hence all issues that fit the JQL which uses the SLA would be affected.

Instead of looking for the SLA in such a case, search for the JQL for the SLA as all issues that fit it should be empty as well.

If there is a special use case where the SLA value is somehow cleared, we would recommend fixing the SLA itself.

There is a suggestion raised here: for this feature and probably more light would be shared on this by the developers on the ticket for anyone interested.


Thanks for sharing the link, I was going to do it just now after creating the suggestion smile

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Jira

Updates to give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

584 views 1 15
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