I am using Jira Cloud. In that while using Script Runner, I am facing this isuue.I am trying to calculate the Total Time Spent by a Story in "In Progress" Status. So, whenever it moves to "Done" Status, there is custom field which shows the time spent in this format (d h m s). Note: The Story can be Reopened again. So, the time should be added accordingly. Below is my code for Script RunnerWhat to do?
Hi Jaynath,
The issue appears to be with line 122, where you go to update the issue.
ScriptRunner for Jira Cloud uses Unirest to make rest calls, so you should use Unirest rather than httpClient, which is not a supported package.
I can confirm we have an example of updating a field on an issue here on line 32 that you can use as an example to help refactor your script.
I hope this information helps.
Regards,
Kristian
Yeah, I tried that method too, but it is not working. Do you have any other idea for my query.
What type is the field you are trying to set, and how is this script configured?
The script is configured in a way that, the time starts to count when Story moves to "In Progress". And after it transition to "Done", the calculated time should be displayed in a custom field (text field) and time should stop when the Story is in "Done" status. Now, if the Story is reopened or moved to "In Progress" status again, the time should start. After it moves to "Done" status, the value in the custom field and this new time should be added and displayed in the custom field.Note: The Story should only have one field for Total Time Spent by the Story in "In Progress" status. The time should in this format (days hours min sec)
It looks like you're new here. Sign in or register to get started.