Hello,
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 1.2.6.1 / 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".
Base set
project = MYPROJECT
100 issues
project = MYPROJECT AND "My SLA" = breached()
5 issues
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.
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
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! 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.
Accepting your solution since it seems to work, but I'd rather have the JSDSERVER-4650 for a clean way to solve this :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amazingly overcomplicated workaround for a feature that would seem very obvious to have.
I added my 2 cents in a comment in the suggestion ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried the solution you suggested, but it shows this error:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's solved by adding the () In the query:
project = MYPROJECT AND ("My SLA" = breached() OR "My SLA" != breached())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Thanks for sharing the link, I was going to do it just now after creating the suggestion
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just tried in 3.2.7 and 3.3.0 and it's not possible in later releases either. Same operator options available.
Regards,
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.