Measuring time in minutes between two statuses?

Tomasz May 9, 2023

Dear,

I'am looking for a solution where I could measure time in minutes between two specific statuses in a ticket:
specifically between new ticket is registered, and closed. 

e.g.: NEW->....CLOSED

Is there any solution I could use to calculate this and have these result stored in a custom field? 

I have tried with scriptrunner and code below, but unfourtanetly where there will be some other status set, measure is not calculating any longer.....(only for this one particular). 

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean

// Status to be counted
final statusName = 'New'

def changeHistoryManager = ComponentAccessor.changeHistoryManager
def totalStatusTime = [0L]

// Every status change is checked
def changeItems = changeHistoryManager.getChangeItemsForField(issue, "status")
changeItems.reverse().each { ChangeItemBean item ->
    def timeDiff = System.currentTimeMillis() - item.created.time
    // Subtract time if the "from" status is equal to the status to be checked and from and to statuses are different.
    // This allows to count the time the issue is in the state for the first time
    if (item.fromString == statusName && item.fromString != item.toString) {
        totalStatusTime << -timeDiff
    }
    // Add time if the "to" status is equal to the status to be checked
    if (item.toString == statusName) {
        totalStatusTime << timeDiff
    }
}

def total = totalStatusTime.sum() as Long
// Every time (added or subtracted) is summed and divided by 1000 to get seconds
(total / 1000) as long ?: 0L

 

Any solution or help highly appreciated. Thank you!!!!!

 

 

4 answers

2 votes
Valeriia_Havrylenko_SaaSJet
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 9, 2023

Hi @Tomasz 👋

As an alternative you can try Time between Statuses developed by my SaaSJet team, which gives you ability to check time in minutes between two statuses. 

How it looks like:

Знімок екрана 2023-05-09 о 14.37.43.png
Also you can set the start/stop/pause timers to get Jira time in status data. Determine time limits to highlight overdue issues. And you will be able to send email notifications about warning issues.

After you will be able to export the report as CSV or XLSX files easily.

Add-on has 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

0 votes
Yaniv Bernhard July 5, 2023

Hi All,

 

I tried "Time between statuses" but it allows me only use a Project for the data while I want to use a specific filter contains all of my customers defects.

Any suggestions on how to measure the time between Created and Done for specific filter?

Valeriia_Havrylenko_SaaSJet
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
July 5, 2023

Hello @Yaniv Bernhard 👋

If your filter includes the issue type, one project and some date range, then it will be possible to do this on the report itself. 

Time Between Status.png

Also i suggest you to book a demo session to solve your case faster 🚀

Hope my answer helps you 😌
Valeriia

Yaniv Bernhard July 5, 2023

Thanks, I booked a session.

0 votes
Emre Toptancı _OBSS_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 9, 2023

Hello @Tomasz

I can recommend Time in Status which is built by my team at OBSS. 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 and on each assignee

tisCloud_StatusDuration_LeadTime_with Estimates.png  tisCloud_AssigneeDuration.png     

Time in Status offers two report types for your case:

The first one is Status Duration report (please see the screenshot above) which shows how much time each issue spent on each status. Ypu can combine status times to see measurements like Issue Age, Cycle Time, Lead Time, Resolution Time etc.

As an alternative approach, Time in Status also has Duration Between Statuses report type which shows the duration between two specific statuses. This report type also allows the user the exclude the times for "pause" statuses.

tisCloud_DBS_Metrics.png  tisCloud_DBS_Report.png

These reports show a list of issues by default so you can see the metric values for each issue separately. Also, for all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total cycle time per customer (organization) 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.

All these report types, including averages and sums, can be turned into charts.

Time in Status 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.

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.

And the app has a REST API so you can get the reports from Jira UI or via REST.

Gadget_AverageStatusDurationByComponent.png  tisCloud_StatusDuration_LeadTime_Chart.png

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

EmreT

0 votes
Bloompeak Support
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 9, 2023

Hi @Tomasz

If lead time report (the time interval between the moment an issue is requested to the moment it is completed) is what you need, you can try Status Time Reports app developed by our team. For more detail, you can have a look at the article below.

Cycle Time and Lead Time in Jira: Productivity Measurement with Two Critical Parameters

Here is the online demo link, you can see it in action and try without installing the app.

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

Hope it helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events