Hello, Community!
I would like to share a solution to a fairly common problem that you could apply in your practice.
The article consists of the following sections:
What are the advantages of this solution
Some time ago we ran into the following task:
"How to conduct analytics on the actual time spent on solving problems(retrospective analysis of closed issues)."
We used Jira Service Desk, where SLA is flexibly considered out-of-the-box.
This is a very convenient and useful feature, without which working with Clients would be less transparent and comfortable.
Some useful docs about SLA:
In simple words, the essence of the SLA in our case is to show "whether we have time to provide a service at the specified time or not?"
Therefore, we see for each issue:
Also, when you hover the mouse cursor over on stopped SLA-indicator, the following appears:
As you can imagine, the actual time is exactly the indicator that we would like to analyze (build dashboards, upload to CSV/Excel and so on).
But, unfortunately, this indicator could only be obtained in the way described above (by mouse hover) and it was impossible to work with it.
To solve our problem, we used existing JMWE plugin.
Since our process involves one single transition to the final status, we have added 2 post-functions "Set field value (JMWE app)" on this transition, which calculate the actual time in 2 fields.
Field - "field1.name"
Value type - Groovy Expression
Value -
try {
return issue.get ("SLA field name"). completeSLAData.last (). elapsedTime / 60000
} catch (Exception e) {
return null
}
Where - SLA field name is the name of the SLA metric you need.
Result(for example) - 74.371
Field - "field2.name"
Value type - Groovy Expression
Value -
import com.atlassian.core.util.DateUtils
try {
return DateUtils.getDurationPretty (((issue.get ("SLA field name"). completeSLAData.last (). elapsedTime) / 1000) .toLong (), ComponentAccessor.jiraAuthenticationContext.i18nBean.resourceBundle)
} catch (Exception e) {
return null
}
Where - SLA field name is the name of the SLA metric you need.
Result - 1 hour, 14 minutes
It is also possible to set the following Options or Conditional execution:
We have achieved a fairly simple and flexible solution for the task that we faced.
If you have any ideas how we could improve our solution, please let us know in the comments, we are ready for changes for the better.
If you have any questions - also do not hesitate to ask them in the comments.
I would like to thank the JMWE support service - you can always turn to them for help and get a high-quality recommendation and solution to the problem!
In our case, we counted the actual time at the time of resolving (closing) the problem, but if you need to understand the actual time spent at any moment, you can look at the JMCF plugin that will allow you to create a scripted field.
Good luck!
Alexander Bondarev
Atlassian Certified Expert
Russia, Moscow
132 accepted answers
2 comments