JQL filtering on SLA values?

Dave Hollinden June 27, 2017

I can use JQL to find issues that breach an SLA like this:

"Response in 60 min." = breached()

What I'd like to do is create a series of filters that are more granular. For example, one filter might return issues on which the SLA was breached by less than 3 hours, another for breached between 3 and 6 hours, another for breached from 6 to 24 hours. I could then add these filters to a Multiple Filter Pie Chart and get a simple report on how we're measuring up against the SLA for an entire quarter. 

Is this possible? I can see the numerical values for the SLA in the issue navigator, but can't find any syntax that lets me use comparisons on those values. 

I suppose I could create additional SLAs at 3, 6 and 24 hours, but would prefer not to. 

Thanks in advance.

2 answers

1 accepted

1 vote
Answer accepted
Dave Hollinden June 28, 2017

I wonder, though, if I can create a calculated field that contains the SLA field value in date-time format, and then use if for my filters. We have both JIRA Misc Custom Fields and Scriptrunner. 

Dave

Dave Hollinden June 30, 2017

This script did the trick for me in a JIRA Misc Custom Fields "Calculated Number Field"

<!-- @@Formula:
// log.error("In Issue "+issue.get("issuekey") + " the value of field 13861 = " +issue.get("customfield_13861"));
if (issue.get("customfield_13861").getCompleteSLAData().empty)
return null;
return issue.get("customfield_13861").getCompleteSLAData().get(0).getElapsedTime()/(60*1000)
-->

That gives me a field with the elapsed time as a number, so I can create filters like this:

project = projectX AND "Response Time Elapsed" < 15

Thanks, 

Dave

somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 30, 2017

Hi Dave,

Thanks for voting on the issue and providing your work around.  I upvoted your answer so hopefully someone else will be able to benefit from this!

Cheers,

Branden

0 votes
somethingblue
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2017

Hi Dave,

In regards to the SLA time metrics, elapsed() and remaining() can be natively queried against but they don't provide time that has past since the breach.

On Server, one option for finding those values may be the Time to SLA Plugin for JIRA add-on.  It has a function called issuesHaveSomeExceededSlas.  It filters issues which have at least one exceeded SLA. SLAs which are not completed but already have a breach are also included.

Next, there is a feature request for this that you can find at JSDCLOUD-4059 for Cloud and JSDSERVER-4059 for Server.  Please vote on them and add your use case to the comments to add impact our developers will consider adding this in the future.

Finally,  please see some of the other suggestions in the Community:

Reporting on recently breached SLAs with JIRA Service Desk


Cheers,

Branden

Dave Hollinden June 27, 2017

Thanks, Branden. I voted on the JSDSERVER issue. And I'll check out the Time to SLA plugin.

We currently use JIRA Enhancer plugin, but I can't get what I need there. Our JSD SLA is satisfied with either a comment or a status transition, so it can't be replicated in JEP. 

Thanks,  

Dave

Suggest an answer

Log in or Sign up to answer