Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can we calculate Issue Age and Time in status field in JIRA Cloud in Scriptrunner

Divya Sudhakar _US - ADVS_
January 26, 2026

How can we calculate Issue Age and Time in status field in JIRA Cloud in Scriptrunner

6 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Mariia_Domska_SaaSJet
Atlassian Partner
February 6, 2026

Hello, @Divya Sudhakar _US - ADVS_ 

I understand your original question focused on ScriptRunner, but I noticed my colleagues have suggested several alternative solutions. I also found your question interesting.
I work with AI Apps Builder, an AI-powered tool that lets users create custom dashboards and gadgets from a simple prompt. As a small experiment, I tried to solve part of your use case by building a custom gadget for issue age.
This was the prompt I used:
Create a gadget that calculates the age of issues (time since creation) and displays it as a chart with hours on the Y-axis and current status on the X-axis. Add a dropdown to filter by project.
The result:
Issue_age_gadget.png
This gadget can be further improved and extended by chatting with AI, or you can download the generated code and improve it by yourself.
If you are interested, I encourage you to try AI Apps Builder and experiment with your own version of the dashboard.
I hope this is helpful.
0 votes
Birkan Yildiz _OBSS_
Atlassian Partner
January 27, 2026

Hey @Divya Sudhakar _US - ADVS_ 

While ScriptRunner is a powerful tool, calculating accurate time durations requires complex scripting to parse the change history log and account for working calendars (excluding weekends and holidays).

If you are open to using a marketplace app, Timepiece - Time in Status for Jira has a solution that calculates "Issue Age" and "Time in Status" instantly without a custom field or complex scripting.

You can use Timepiece’s Duration Between Statuses report to calculate Issue Age. It allows you to define a metric to measure the total time from the start of your workflow (Issue Creation) to the end (Done or Closed):

image-20251126-122824 (1).png

Additionally, it works retroactively for all your past issues from the very beginning.

 

For Time in Status:

You can use the Status Duration report. It lists each issue and calculates exactly how long it spent in every status, handling multiple visits and historical changes automatically.

image-20260127-142937.png

You can check Timepiece on the Atlassian Marketplace. Hope this helps you track your Issue Age and Time in Status easily.

Full disclosure: I'm on the team that makes Timepiece - Time in Status for Jira.

0 votes
Rahul_RVS
Atlassian Partner
January 27, 2026

Hi @Divya Sudhakar _US - ADVS_ 

You can use Jira Rest API's to build your own custom solution or If you would like to try out a mktplace app for this requirement, you can try out

Time in Status Reports 

With this app you generate time in each workflow status for multiple issues with multiple filter and grouping options. 

With Status grouping feature, can help you define your own issue age time and view the averages of the same. Also the app has 20+ reports to meet a variety of use cases.

More details here.

Disclaimer : I am part of the app team for this add-on

 

 

TIS.png

 

0 votes
Danut M _StonikByte_
Atlassian Partner
January 27, 2026

Hi @Divya Sudhakar _US - ADVS_,

Why do you need this? And do you need this as a Jira field, or as a report or gadget?

If you want these as a fields, you can take a look on this existing topic that describes how to add a scripted field in ScriptRunner to calculate the issue age: https://community.atlassian.com/forums/App-Central-questions/Age-of-issue-in-Days-using-Scriptrunner-Scripted-Field/qaq-p/1552535

Not sure how to configure such a field for time in status—it may be a bit more complex, since it requires using the issue history...

But if you need these for reporting purposes, and alternative would be to use an app (plugin) from Atlassian Marketplace that provides such reports. If you are willing to try such an app, our Great Gadgets app offers two gadget that can be of great help:

WIP Aging Chart gadget - calculates the age of the issues and display them as plot chart. The age can be calculated in many ways, including "time since creation" or "time since current status".

image.png

The gadget offers a Data tab, with a report that lists the issues and their age, which can be easily exported in CSV.

image.png

Time in Status gadget - Display the average or total time in status for the issue from a filter or board.

    image-20240726-050051.png

This also offers a Data tab with a report containing the issues and time in every status.

 Time-in-status-gadget---data-table.png

Danut 

0 votes
Petru Simion _Simitech Ltd__
Atlassian Partner
January 26, 2026

Hi @Divya Sudhakar _US - ADVS_ , 

 

Just to set expectations: calculating metrics like Issue Age and Time in Status in Jira Cloud isn’t straightforward out-of-the-box. Jira’s default reporting doesn’t store these durations in fields you can simply pull with JQL or native automation. You’d need to track status transition timestamps in custom fields and then subtract them manually, or process issue history  — both of which are really manual/fragile approaches.

Because of that complexity, many teams use a Marketplace reporting app to accurately compute these timelines — especially when you want it for all issues over time, or break it down by status, assignee, or workflow stage.

If you’re looking for an easier solution built specifically for this by our team , Time in Status Reporter for Jira provides detailed status-duration analytics based on real issue history:

  • 📊 Time in Status for each status

  • 📏 Times in Status (how often each status was entered)

  • 📅 Status Entry Dates

  • 📈 Cycle and Lead Time reports

  • 👤 Time in Status per Assignee and Status Groups

  • 📤 Full CSV export and interactive charts

It calculates all of these reliably from your Jira issue history so you don’t have to build and maintain custom automation rules or rely on hacks.

Using a tool like this lets you get Issue Age and other timeline metrics with much less manual work and more accurate results — ideal if you want to analyze across projects or workflows without scripting or external processing

 

Regards, 

 

Petru

 

 

0 votes
Artem Taranenko
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 Champions.
January 26, 2026

For clarity, are you looking to have calculated fields:

  • Issue Age - calculates number of days since issue creation
  • Time in Status - calculates time (days, or Days & Hours) in current status

Other possibility is to have time in status report for each status, but I assume you're talking about calculated fields

TAGS
AUG Leaders

Atlassian Community Events