How to find smart value of SLA component of JSM issues
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Jira admins sometimes need access to the SLA value. While the SLA value is visible in both due date centric or time centric formats, there is no direct way to access this value because of the way SLA information is stored.
Solution
SLAs in Service tickets
SLAs on a JSM issue allow you to track the status of an SLA by displaying:
The type of SLA you are measuring (time to resolve, time to first response, etc.)
Whether SLA is met, running, or breached.
How long you have left until an SLA is breached or how soon the SLA is completed.
However, you can't access the values of the SLA as any other custom field. Also, when you export the SLA information the duration value is exported as text and is displayed in the number of hours/minutes even with the Due date-centric SLA time format.
For example, if you wish to setup a Due date field based on the SLA value, you can highlight the SLA in a different way on the issue for the assignee to start working on it - If the Time to response SLA is pending for 1d, you can convert that into a Date and set the value of the Due Date field.
Finding the smart value of the SLAs
We will use the same approach as described in Find all available smart values for a Jira issue.
Each SLA value of an issue is stored in JSON format. Use Log action in automation to print the smart value of {{issue.<sla_name>}} to see the main objects in the ongoingCycle and completedCycleand see what information you might find useful. Step through each layer of the JSON object, You can drill into these different areas using the "." notation.
Here is an automation rule to find the breach time of an issue, you can use this value and store it in a date time custom field as well:
Create an Automation rule with Scheduled trigger.
Add Log action to display the value of the smart value {{issue.<sla_name>}}.
Add Create variable action to create a new variable (named SLA for instance) with the value {{issue.<sla_name>.ongoingCycle.breachTime.friendly}}.
Add another Log action to display the value of the variable {{SLA.toDate.jiraDate}}.
Was this helpful?