Can you please help with a script to implement time in status in jira using groovy

prasad biddika
Contributor
June 16, 2023

We want to know the time in each status in Jira.

We are using jira DC.

Can you please help with a script to implement time in status in jira using Groovy?

 

Thanks,

Prasad

5 answers

2 votes
Valeriia_Havrylenko_SaaSJet
Atlassian Partner
July 13, 2023

Hi   @prasad biddika  👋 

I guess Time Between Statuses will be an option for you. This add-on, which measures connections in the workflow, through a transition time in specific issues. You can count Cycle and Lead Time by setting start/stop and pause statuses in the configuration manager. To detail the calculation conditions you should select the first/last transition to/from status. This add-on developed by my team.

 Time Between Satuses.jpg

As an alternative , and if you switching to a cloud version, you can try Time in Status for Jira Cloud. The primary purpose is to help teams gather valuable data about the lifecycle of your issues in Jira. Add-on allows you to measure and visualize the time spent in each status, such as "Open," "In Progress," "In Review," and "Closed," and provide 7 types of reports to help you identify areas for improvement. Add-on also developed by my team.

Time in status GIF.gifAdd-ons have a 30-day free trial version and free up to 10 users. 
Please, let me know if you have any questions

Hope it helps 😌
Valeriia

1 vote
Madhu_RVS
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.
June 16, 2023

Hi @prasad biddika 

 

If you would be interested in a readymade solution, you can try out
Agile Tools : Epic Tree, Links Tree, Time in Status & Worklogs

The add-on provides the time for each status in the issue lifecycle.

You can also create a Dashboard gadget out of it with graphs too.

Also there are 20+ reports in the app which help to meet a wide range of use cases.

Do try it out. 

Disclaimer : I work for RVS, the vendor for this app

TIS.PNG

0 votes
Emre Toptancı _OBSS_
Atlassian Partner
June 16, 2023

Hello @prasad biddika

I know you asked for a script solution but let me recommend an alternative since scripts are expensive to build and maintain. Using a ready-to-go marketplace solution will be cheaper and more comprehensive.

Our team at OBSS built Time in Status for this. It is available for Jira Server, Cloud, and Data Center.  

Time in Status mainly allows you to see how much time each issue spent on each status or each assignee

tisCloud_StatusDuration_LeadTime_with Estimates.png    tisCloud_AssigneeDuration.png

You can combine the time for multiple statuses to get metrics like Issue Age, Cycle Time, Lead Time, Resolution Time etc. 

For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer or average resolution time per sprint, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend. 

tisCloud_StatusDuration_LeadTime_Average_TimeGrouped.png

The app calculates its reports using already existing Jira issue histories so when you install the app, you don't need to add anything to your issue workflows and you can get reports on your past issues as well. It supports both Company Managed and Team Managed projects for Jira Cloud.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets, and issue view screen tabs. All these options can provide both calculated data tables and charts.

Gadget_AverageStatusDurationByComponent.png  tisCloud_StatusDuration_LeadTime_Chart.png

https://marketplace.atlassian.com/apps/1211756/

EmreT

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
June 16, 2023

Hi @prasad biddika

If you prefer to use a marketplace app, you can try Status Time Reports app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.

Here is the online demo link, you can see it in action and try without installing the app. For your case, you can have a look at Time in Status for Each Issue report.

  • This app has a dynamic status grouping feature so that you can generate various valuable reports as time in status, time in assignee, status entry dates and status counts, cycle time and lead time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).
  • You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
  • Status durations are calculated according to the working calendar you define. Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days.
  • You can set different duration formats.
  • You can export reports in CSV file format and open them in MS Excel.
  • You can also add this app as a gadget to your Jira dashboards and reach “Status Time” from Issue Detail page.
  • You can enable/disable access to Status Time reports&gadgets and Issue Detail page per project, users, groups or project role.

If you are looking for a completely free solution, you can try the limited version Status Time Free.

Hope it helps.

0 votes
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 16, 2023
prasad biddika
Contributor
June 16, 2023

Hi thanks for the the answer I checked in console it throwing the following error in the below mentioned line

groovy.lang.MissingPropertyException: No such property: issue for class: Script47
at Script47.run(Script47.groovy:11)

def changeItems = changeHistoryManager.getChangeItemsForField(issue, "status")

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events