Forums

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

Tracking time in status

danielho95 August 20, 2018

Hi all, 

I am trying to write a script that calculates the time spent in each status. I have adapted the code from scriptrunner documentation, replacing the status "In Progress" with "Allocated".


https://scriptrunner.adaptavist.com/latest/jira/scriptedfields.html#_total_time_this_issue_has_been_in_progress

It currently returns Allocated Length:-347009

Could anyone please advise me on how to fix this error (I assume there is an error due to the negative value for time) and display the value in a weeks, days, hours, minutes format?

Thank you

2 answers

0 votes
ABRAR ALMADI May 8, 2020

@danielho95 

did you find a solution to the problem i am facing the same issue and i would really appreciate your help 

 

@Rahul Khire 

can you please give more details it may help me 

0 votes
Rahul Khire August 20, 2018

I did not use Script Runner, but created a plugin which shows how much time an issue spent in each status in its workflow.

I used ChangeHistoryManager.getChangeItemsForField(issue, "status") to get the full Status change list and then iterate through that list to get individual status times.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events