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
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.
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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;
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
Disclaimer : I am part of the app team for this add-on
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IMHO, the best way to get the statuses would be to use JIRA REST API to get the changelog
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.