Need to create Scripted field for time to resolve ticket.

siva
Contributor
November 8, 2020

Custom field to be created using script runner

 

1. time in Current status.

2. time in two stauses.

 

Any suggestions to created the scripted fields for those. 

 

4 answers

0 votes
bilel_arfaoui December 5, 2023

If you are on Jira cloud you can create a custom field and calculate the Time in status in seconds/minutes/hours/days, it should be like this :

  • Create a custom field with date and time type.
  • Create 1st automation with trigger transition to and choose the desired status then an edit component for the created field and set it with the {{now}} smart value.
  • Create a 2nd automation and the trigger will be transitioned from the desired status and then add a component to change a new plain text field (which will contain the time in status value) to this smart value "{{issue.customfield_id.diff(now).minutes}}.
  • And here we go you got the time in status in minutes.
0 votes
Ed Letifov _TechTime - New Zealand_
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.
November 9, 2020

Hello,

Consider this – why are you not asking people to just record their time in Jira using default out of the box functionality? Have you tried numerous solution where user is supposed to start, pause, resume and stop a timer on the issue? Did it ever work properly for your team?

Ask yourself – why? Is it because that users are busy, lazy and oblivious (to the needs of accurate time reporting)?

So what makes you think that humans will move an issue through workflow statuses in any way that actually corresponds to the real time they spend working on it?

Instead of relying on this assumption – you can track time instantly, automatically and accurately with EasyTime for Jira available on Server, Data Center, and Cloud. EasyTime does it based on the events (view the issue, leave a comment, close/resolve the issue) that users naturally generate while working, they don't have to do anything extra.

Please do take a look. Reach out to our 24x7 support via Service Desk or the chat widget on our website

0 votes
Zoryana Bohutska _SaaSJet_
Atlassian Partner
November 9, 2020

Hi @siva 

You can also consider another tool for status time tracking Time in Status for Jira Cloud by SaaSJet. It lets you get time in each status automatically. Time in two statuses, you can get using the status group feature. This feature allows you to sum the time duration of statuses you need.

I hope this will help.

0 votes
Milan Chheda [INFOSYSTA]
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.
November 9, 2020

Hi @siva ,

 

I would recommend to check the Time In Status add-on that provides you exactly what you are looking for.

I wouldn't create scripted field primarily because, if there are 4 statuses, then you will have to create 3 scripted fields and write + maintain code for each, and update later whenever new status gets introduce, etc. It just creates more maintainability and an increase in number of custom fields. It would be better to have the add-on take care of it and reduce the overhead.

 

Thanks,
Milan

siva
Contributor
November 9, 2020

We do have time in status , 

But , i need to show time to resolution in a scripted field any recomendations where i can implement that

Suggest an answer

Log in or Sign up to answer