How to get the day when Status has changed

Philip Abdalla
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 29, 2025

Hello, 

I am writing a Python script that needs to get all the tickets that are blocked, and then write them as csv file. I am able to get all the tickets that are blocked but the problem is that I would like to know the latest day where the ticket has been blocked so that I can calculate how long it has been blocked for. How can I do that?

 

Thank you

7 answers

2 votes
Yuliia_Borivets__SaaSJet_
Atlassian Partner
January 30, 2025

Hi @Philip Abdalla 

Here is a similar post you might check: https://community.atlassian.com/t5/Jira-questions/status-changes-timestamp/qaq-p/2909209

The second top answer shows how to get status changes using the JIRA REST API: https://community.atlassian.com/t5/Jira-questions/Is-it-possible-to-get-the-issue-history-using-the-REST-API/qaq-p/510094

Also, as an alternative solution, you can try Issue History for Jira app from my team.  It allows you to create a report with all status transitions or select a specific status.

Jira status transition history dates.jpg

 

1 vote
Hannes Obweger - JXL for Jira
Atlassian Partner
February 2, 2025

Hi @Philip Abdalla,

welcome to the community!

an issue's status changes are captured in an issue's issue history, which you can access from the issue view in Jira or via Jira's REST API. From the history entries, you can find the date that a particular status change happened - however it can be quite tricky to do that by hand.

That's the reason why a lot of users rely on solutions from the Atlassian Marketplace to do that for them. E.g., you may want to have a look at the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a long list of so-called history columns that aren't natively available, including the date of transition to [status], time in [status], and many, many more.

This is how it looks in action:

date-of-transition.gif

As you can see above, you can easily sort and filter by your history columns, and also use them across JXL's advanced features, such as support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting. Of course, you can also export your data to Excel or CSV in just two clicks.

Any questions just let me know,

Best,

Hannes

1 vote
Ayça Erdem_OBSS_
Atlassian Partner
January 30, 2025

Hello @Philip Abdalla 

Welcome to the community

You can track how long each ticket has been blocked by checking when it last transitioned into the Blocked status. One way to do this programmatically is by retrieving issue history through the Jira REST API and extracting the timestamp of the latest status transition. This would allow you to calculate how long the issue has been blocked.

Another approach is using a third-party app from the Atlassian Marketplace that specializes in time in status tracking and reporting, making it easier to get these insights without manual calculations.  Timepiece - Time in Status for Jira, developed by my team at OBSS provides reports like Status Duration Report, which automatically calculates the total time an issue spends in each status, including how long tickets have been in "Blocked." Additionally, all reports can be exported as CSV, making it easy to integrate with external workflows or further analysis in spreadsheets.

Here is the screenshot which shows status duration report;

2.png

If you'd like to explore this solution further, feel free to check out Timepiece - Time in Status for Jira on the Atlassian Marketplace or schedule a demo with us for a walkthrough of the app's features.

 

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.
January 30, 2025

Hi @Philip Abdalla 

Welcome to the community !!

You can use Jira Rest API's to pull this information Or If you would be interested in a mktplace app for a readily available solution, 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. You can also group your statuses to define your own resolution times.

For your specific requirement, the Status Transition Details reports will show the date when the status was changed and by whom.

More details here.

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

TIS - Status Transition Details.PNG

1 vote
Bill Sheboy
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.
January 29, 2025

Hi @Philip Abdalla -- Welcome to the Atlassian Community!

That information is stored in the changelog for issues, and it is difficult to access for reporting use in Jira.

How you solve this need depends upon ability to spend time / money:

  • You note using a Python script.  And so you could try calling the REST API endpoint to access the changelog to find when the issue was blocked.  That endpoint is limited to 100 records at a time and uses pagination; thus if the issue has changed often since the blocking, multiple calls will be needed.
  • There are marketplace apps which make it easier to directly access the changelog, so perhaps investigate them in the Atlassian Marketplace
  • One could also add a custom field to record the last date / time an issue became blocked using an automation rule.  That field could then be used in your CSV file.

Kind regards,
Bill

0 votes
Petru Simion _Simitech Ltd__
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.
January 30, 2025

Hi @Philip Abdalla ,

 

The information is available in issue history, and the JIRA REST API allows you to extract all that information, however it will prove code intensive and will take a significant time to develop and test.

Using a custom field to record the last change, aka blockage has two caveats. One is that the solution will only work from the moment it is implemented, leaving you with the previous issues not calculated. Also you will need to see how do you export the values from multiple fields.

If you are open to using apps and deppending what you mean by having to know the last time the ticket has been blocked, you could use one of the apps released by our company.

 

If you are just interested to depict a certain transition that represent the time the ticket got blocked and later calculate yourself the time you could use Issue History Dashboard for Jira .

You can search for all issues in a project  or filter by various criteria. 

The result will show you what field was updated, when, by whom and the value changed from and value changed to.

 

issue_history_dashboard_filter_and_search_result_for_project_light.png

 

On the other hand, if knowing how much time the issues have spend in each status, would suit your purpose, you can use Time in Status Dashboard for Jira .

You can also search for all issues in a project or filter by various crieteria.

The result will show how much each issue spent in each status of the workflow the issue was transitioned into at least once. The time will be cumulative, in case the issue was transitioned into a status more than once. You will also be able to see how many times the issue was present in each status.

You can then sum up the time spent in various statuses, to calculate what your company considers time spent for a "blocked" issue. You can later drill in more into data, calculate using Excel formulas or whatever other system you want to input your csv format data into, and create your own charting.

The result is shown in two perspective.

Both results are in tabular format, sortable and exportable to csv.

The Columns perspective shows you each issue in a row and each of the time spent in each status as a separate column.

 

time_in_status_columns.png

 

The Rows perspective shows each issue time spent in status in a separate row, making calculations and data manipulation easier after exporting to csv and importing into Excel or other systems.

time_in_status_result_rows.png

You can select from multiple data formats the one that best suits you.

The purpose of these apps is to give you the raw data and allow you to define logically your cycles, blockages etc. based on your company workflow design, and give you the posibility to export to other systems for further data manipulation, calculations and charting.

 

Regards, 

 

Petru

 

 

0 votes
Rustem Shiriiazdanov
Contributor
January 30, 2025

Hi @Philip Abdalla 

IMHO, the best way to get the statuses would be to use JIRA REST API to get the changelog

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-changelog-get  

API described above returns a paginated list of all changelogs for an issue sorted by date, starting from the oldest, and then you can extract the status change information from the response JSON.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events