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 18.104.22.168 / JIRA 6.3.15 , but I wonder if this is possible with latest versions.
Thanks in advance for your help,
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".
project = MYPROJECT
project = MYPROJECT AND "My SLA" = breached()
project = MYPROJECT AND "My SLA" != breached()
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.
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())
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())
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())
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()
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"
We have a winner!
There's a Feature Suggestion for this to make it easier. Vote it up! https://jira.atlassian.com/browse/JSDSERVER-4650
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.
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: https://jira.atlassian.com/browse/JSD-4650 for this feature and probably more light would be shared on this by the developers on the ticket for anyone interested.
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...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG