Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion of SLA duration to days/hours/seconds

Samuel Esposto April 15, 2019

Hello,

 

In the database, SLAs are stored in a JSON. We are not able to convert the durations to seconds. 

 

As an example, remainingTime is defined to 160737884. In the ticket, we can see that this number corresponds to -3w 2d. 

 

 "ongoingSLAData": {
"goalId": 568,
"startTime": 1550044924587,
"paused": false,
"thresholdData": {
"calculatedAt": 1553690462471,
"remainingTime": -160737884,
"thresholdsConfigChangeDate": 1547482170530,
"thresholdsConfigChangeMsEpoch": 1547482170530
}
}

 

What is the conversion rule? Does it take the calendar into account?

 

Thanks in advance,

3 answers

0 votes
Samuel Esposto July 25, 2019

Hello,

Coming back to this question: the milliseconds theory doesn't work.

As an example, In jira, the remaining time is 2d 11h while is it 98858.

 

98858 / ( 1000 * 60 ) = 1.647 hour. 

Regards,

0 votes
Samuel Esposto April 17, 2019

.

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 16, 2019

Hi Samuel,

The Time values for SLA's in Jira Service desk are stored as an epoch time value of emochmills, and the "remainingTime" is in milliseconds mills.  So the value of -160737884 should be ~-44 hours, and that value would be counting down to 0 for the SLA and negative numbers are breached.

the value 1550044924587 converts to a GMT time of Wednesday, February 13, 2019 8:02:04.587 AM,  

The Epoch time value is discussed and touched on towards the bottom of our "How to Troubleshoot SLAs in JIRA Service Desk" guide:

So how do you know what is the startTime field? You can go to http://www.epochconverter.com/ to convert the value to a more readable human format. Once converted, you will know that the startTime for the SLA is Wed, 26 Aug 2015 11:15:43 GMT.

But check out the Epoch converter and guide noted above as it goes into more detail on the values for the SLA values, and let me know if this clears things up for you.

Also as noted in the Article above additional details can be bulled from the API endpoint as well, and the API value returns a human readable "friendly" value along with the epoch times:

Regards,
Earl

Suggest an answer

Log in or Sign up to answer