Forums

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

Calculate how long it takes to close a card.

Steve Steve June 25, 2021

We would like to calculate how long it takes to close an issue. One approach would be to subtract the resolution date from the created date. The problem with this approach is that an issue may wait in "backlog" for weeks before it is actually started.

Is there any way to access when an issue entered the "Work In Progress" state or any other status for that matter?

We are writing data extraction jobs that send JQL queries and retrieve JSON back. We are willing to send other queries to extract other data that would allow us to calculate the actual time spent on the issues from the first query.

For example, for all issues closed in the last 7 days, we want to calculate how much time was spent on those cards. For us, that would be the time it entered WIP to the time it was resolved.

How can we calculate the time an issue was worked to resolution?

5 answers

1 accepted

0 votes
Answer accepted
Steve Steve June 29, 2021

The approach we implemented is calling the REST API using expand=changelog to return all the change items for the issue.  We then extract the status change items and use the created date for the change items that contain the state transition we need.

This results in larger JSON results, but we extract only the change items we want.

1 vote
Sarah Baker
Contributor
June 25, 2021

Hi @Steve Steve 

It sounds like you're looking for a Control Chart, as you're trying to measure Cycle Time (not Lead Time). Here's an article explaining how they work - hope this helps!

https://support.atlassian.com/jira-software-cloud/docs/view-and-understand-the-control-chart/

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.
June 25, 2021

Hi @Steve Steve 

Adding to Sarah's ideas for visualizing cycle time, if you need the data outside of Jira, you could:

  • use a marketplace addon for JQL which supports calculated fields
  • use a marketplace addon specifically for workflow/process measurement
  • use custom fields and Automation for Jira (A4J) to capture changes to statusCategory and statuscategorychangedate to save the cycle time in a custom field for later analysis/export.  There are free and paid versions of A4J for Jira Server in the marketplace.

Best regards,

Bill

Steve Steve June 25, 2021

We are looking for raw data via the REST API, or maybe exporting something from dataplane. The goal is to place the data in a spreadsheet for correlation with other metrics.

We are using the corporate Jira instance that is administered by another team. We don't have the ability to install plugins or make configuration changes. Just access to canned reports and the API.

It is odd that there is no record of state transitions we can query. Particularly since there is a visual indicator of a card's age on the boards (the dots).

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.
June 25, 2021

You could try calling this REST API method with your search, and expand the changelog:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/search-search

Steve Steve June 29, 2021

This is the approach we implemented. While it returns larger result sets, we only keep the status change items, then later use the created dates on the appropriate change items to figure out when the issue first entered the Work In Progress state.

Like Bill Sheboy likes this
0 votes
Emre Toptancı _OBSS_
Atlassian Partner
June 28, 2021

Hello @Steve Steve 

I am afraid there is no way to do this out-of-the-box. Yet, there are some solutions worth mentioning here:

You can use the built-in Control Chart (that is available as part of Kanban Board reports) about this but it is not very good with reopens. It will show you durations but it won't show individual issues. It is more aimed towards seeing the big picture. Plus, you can't get its raw data.

There are the Average Age Report or Resolution Time Reports. Both are available under project reports or as dashboard gadgets. Unfortunately, both reports also are very high level. They just show daily average data and don't show individual issue data. Average Age Report excludes resolved issues and Resolution Time report excludes non-resolved issues so resolving an issue excludes that issue from one report and adds it to the other. This causes unexpectedly rapid changes in those reports.

The only remaining option (without using a marketplace app) would be to use the cloud REST API to collect the data yourself and do some custom development to build the reports you need.

 

In case you are OK with using a marketplace app, our team at OBSS built Timepiece - Time in Status for Jira app for this exact need. It is available for Jira Server, Cloud, and Data Center.

Time in Status allows you to see how much time each issue spent on each status or assigned to each assignee. You can also combine statuses into consolidated columns to see metrics like Ticket Age, Resolution Time, Cycle Time, or Lead Time

You can calculate averages and sums of those durations grouped by the issue fields you select. (For example, see the total InProgress time per Epic or average Resolution Time per issue type). 

tisCloud_StatusDuration_LeadTime_with Estimates.png  tisCloud_StatusDuration_LeadTime_Average.pngtisCloud_StatusDuration_LeadTime_Chart.png

The app 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.

Time in Status reports can be accessed through its own reporting page, dashboard gadgets and issue view screen tabs. All these option can provide both calculated data tables and charts.

Using Time in Status you can:

  • See how much time each issue spent on each status, assignee, user group and also see dates of status transitions.
  • Calculate averages and sums of those durations grouped by issue fields you select. (For example, see average InProgress time per project and per issue type.)
  • Export your data as XLS, XLSX, or CSV.
  • Access data via REST API. (for integrations)
  • Visualize data with various chart types.
  • See Time in Status reports on Jira Dashboard gadgets (released for cloud, server&DC gadget coming soon)

Timepiece - Time in Status for Jira

EmreT

0 votes
Mehmet A _Bloompeak_
Atlassian Partner
June 27, 2021

Hi @Steve Steve ,

As an alternative, you can try Status Time app developed by our team. It provides reports on how much time passed in each status as well as status entry dates and status transition count.

Once you enter your working calendar into the app, it takes your working schedule into account too. That is, "In Progress" time of an issue opened on Friday at 5 PM and closed on Monday at 9 AM, will be a few hours rather than 3 days. It has various other reports like assignee time, status entry dates, average/sum reports(eg. average in progress time per project). And all these are available as gadgets on the dashboard too.

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

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

0 votes
Fabian Lim
Community Champion
June 25, 2021

Hi @Steve Steve  

If you are looking to just update how long it took to transition from a specific transition you can use jira automation.  

Here is a link for the full tutorial: https://www.youtube.com/watch?v=S2ary5YG-7w 

You can then use your JQLs to extract the tickets you want.

Regards

Suggest an answer

Log in or Sign up to answer