Scriptrunner Duration in Status code not working as expected

Shannon Wright
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 19, 2021

I have used the scripted field from Scriptrunner to calculate the duration of the in progress status on my issues (https://scriptrunner.adaptavist.com/latest/jira/scripted-fields.html#_total_time_this_issue_has_been_in_progress) and that appears to work for everything except the Beginning status.

I use the code above for a scripted field that looks at the beginning status in Jira.  It is returning a negative number.  So, for instance, if my status when an item is created is PENDING APPROVAL, the code seems to be returning a negative number all the time an doesn't give me the actual time the item is in that status.  

Looking at the code, it appears it should be working properly. 
my next test will be to add this to another system to ensure it's not just in this server.

Any other suggestions?

1 answer

1 accepted

0 votes
Answer accepted
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2021

Hi @Shannon Wright ,

 

This article will probably address your issue.

 

https://community.atlassian.com/t5/Jira-questions/How-to-calculate-the-time-in-open-status/qaq-p/639181

 

Hope this helps.

 

Thanks,

 

Ben

Shannon Wright
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2021

That was it.  Thank you, that's exactly what I was needing.

Suggest an answer

Log in or Sign up to answer