Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Measuring time in minutes between two statuses?


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!!!!!



3 answers

2 votes
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 09, 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 😌

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 09, 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


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 09, 2023 • edited May 10, 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
AUG Leaders

Atlassian Community Events