The average number of times the user transitioned the specific workflow status.
Asked by Lakshmi S:

Hi Team,

Is this requirement possible with the any dashboard gadget? or we have "timepiece (Time In Status) addon.  

When a Software engineer builds a solution, the status is changed to "Build in Process". After it's completed it will go to "Waiting for Testing" and then "Testing in Progress" by a Quality Engineer. Sometimes the QE finds something wrong with the solution and sends it back to "Waiting for Build" status. Then the software engineer will work on it to fix the solution that was originally built and move the status to "Build in Process" for the second time. In this example, this task went through the "Build in Process" status twice.  

What we want to see the results is, the average number of "Build in process" that an SE typically has to go through to get a solution completed.  

How I write the JQL for this is :  

project = MD AND issuetype in ("FF Task", "SA Task") AND issueFunction in subtasksOf('issuetype in ("Bug", "Change Request")') AND "Product Type" in ("KK - X12", "TL - X12") AND status changed FROM "Build in Process" to "Closed" AND status changed BY ("test@abc.com") AND "MD Document Type" = 810

any dashboard gadget? Or do we have a "timepiece" (Time In Status) add-on?


Answers:
author: Ram Kumar Aravindakshan _Adaptavist_
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

Based on what scale do you want your average to be calculated? Is it the number of times an Issue in BuildInProgress per day, week or month or from a date range?

I am looking forward to your feedback and clarification.

Thank you and Kind regards,  
Ram

comments: author: Lakshmi S
body: Hi [@Ram Kumar Aravindakshan _Adaptavist_](/t5/user/viewprofilepage/user-id/2988015)   

Thank you for your response. Its everyday count.


author: Ram Kumar Aravindakshan _Adaptavist_
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

For your requirement, you could do this easily with a Custom Scripted Field of Number type and use a code like this:-  

```
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.changehistory.ChangeHistoryManager

def changeHistoryManager = ComponentAccessor.getComponent(ChangeHistoryManager)

def total = [] as List<Long>

changeHistoryManager.getAllChangeItems(issue).findAll {
    if(it['fromValues'].toString().contains('Done') && it['toValues'].toString().contains('In Progress')) {
      total <<  1L
    }
}

(total.sum() as Double)/8
```

Please note that the sample code above is not 100% exact to your environment. Hence, you must make the required modifications.

This will calculate the average number of times an issue is transitioned from one status to another, on average, 8 hours per day.

Below is a screenshot of the Scripted Field configuration:-

![scripted_field_config.png](https://community.atlassian.com/t5/image/serverpage/image-id/344726i438943FDF719E573/image-size/large?v=v2&px=999 "scripted_field_config.png")

I hope this helps to solve your question. :-)  

I am looking forward to your feedback.

Thank you and Kind regards,  
Ram


author: Yuliia_Borivets__SaaSJet_
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

You can also check [Issue History for Jira](https://marketplace.atlassian.com/apps/1220385/issue-history?hosting=cloud&tab=overview&utm_source=Atlassian_Community&utm_medium=referral&utm_campaign=Comment_The-average-number-of-times-the-user-transitioned-the-specific_20240824) app from my team and this article:

[Status transition history for multiple Jira issues](https://community.atlassian.com/t5/App-Central-articles/Status-transition-history-for-multiple-Jira-issues/ba-p/2677388)

In particular, the last use case, "What is the frequency of moving from a specific status to another?" can be helpful.


author: Diego Chen
body: Script Runner

Custom Chart


author: Mehmet A _Bloompeak_
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

As an alternative, you can try [Status Time Reports](https://marketplace.atlassian.com/1221826) app developed by our team. It mainly provides reports and gadgets based on how much time passed in each status.

Here is the [online demo link](http://status-time.bloompeak.io/demo), you can see it in action and try without installing the app. To get a report of how many times (sum or average) an issue is entered to a specific workflow status, you can have a look at [Status Count And Entry Dates](https://bloompeak.atlassian.net/plugins/servlet/ac/io.bloompeak.status-time/st-report?ac.reportid=1277) report. Entry date(see In Development, Ready for Testing, In Testing, In Development columns.) is status transition date and status count(see #In Development, #Ready for Testing, #In Testing, #In Development columns) is how many times an issue is entered to this status.

++App Features:++

* This app has a dynamic status grouping feature so that you can generate various valuable reports as **time in status, time in assignee, status entry dates and status counts, cycle time and lead time, resolution time, average/sum reports by any field(e.g. average in progress time by project, average cycle time by issue creation month).**

* You can search issues by Project, Issue Type, Status, Assignee, Issue Creation/Resolution Date(and any other Date field) and JQL Query.
* Status durations are calculated according to the working calendar you define. 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.
* You can set different duration formats.
* You can export reports in CSV file format and open them in MS Excel.
* You can also add this app as a gadget to your Jira dashboards and reach "Status Time" from Issue Detail page.
* You can enable/disable access to Status Time reports\&gadgets and Issue Detail page per project, users, groups or project role.

For further details, you can have a look at [Status Time Reports How to Videos.](https://www.youtube.com/playlist?list=PLVHoaAkoFPJnG9nLkzcxG0P00ndQgimDs)

If you are looking for a completely **free** solution, you can try the limited version [Status Time Reports Free](https://marketplace.atlassian.com/apps/1222051).

If you have any questions, feel free to [schedule a demo](https://bloompeak.io/schedule-a-call) with us.

Hope it helps.


author: Rahul_RVS_Support
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

If you would be interested in a mktplace app, you may want to try out

[Time in Status Reports](https://marketplace.atlassian.com/apps/1226187/time-in-status-reports?hosting=cloud&tab=overview)

With this app you generate time in status for multiple issues with multiple filter and grouping options. For your particular use case, we have a specific report "Per person per time grain status transition". This will give you the specific transition which the user did and on which dates.  
Also the app has 20+ reports to meet a variety of time in status use cases. Do give it a try.

Disclaimer : I work for the vendor who built this app

![TIS - Per person status transitions.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/344614i0C2F7D6EE47CF758/image-size/large?v=v2&px=999 "TIS - Per person status transitions.PNG")


author: Hannes Obweger - JXL for Jira
body: Hi [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952)

if you're open to solutions from the Atlassian Marketplace, I think you'd like the app that my team and I are working on, [JXL for Jira](https://marketplace.atlassian.com/apps/1224710?hosting=datacenter&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2796105).

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 range of advanced features, including support for (configurable) *issue hierarchies* , *issue grouping* by any issue field(s), *sum-ups* , or *conditional formatting*,
* a long list of so-called *history columns* that aren't natively available, including the *number of status changes between \[status\] and \[status\]*, and many, many more.

With these, you can build a view like e.g. this in just a couple of clicks:

![number-of-status-changes-v2.gif](https://community.atlassian.com/t5/image/serverpage/image-id/344567i38341E74814F131B/image-size/large?v=v2&px=999 "number-of-status-changes-v2.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*.

Any questions just let me know,

Best,

Hannes


author: Gizem G?k?e _OBSS_
body: Hello [@Lakshmi S](/t5/user/viewprofilepage/user-id/11952) ,

It is possible to have this information through [Timepiece (formerly Time in Status) app.](https://marketplace.atlassian.com/apps/1211756/time-in-status?hosting=cloud&tab=overview&utm_source=community&utm_medium=answer)

You can use Transition Count report and as a report option if you choose the average you will get your desired report.

![TC12.png](https://community.atlassian.com/t5/image/serverpage/image-id/344268iBF2CBD7E2996FF88/image-dimensions/269x161?v=v2 "TC12.png")

![TC11.png](https://community.atlassian.com/t5/image/serverpage/image-id/344267iAEAFDD571FFBCEDE/image-size/large?v=v2&px=999 "TC11.png")

Disclaimer: I am the product manager for Timepiece app in our company OBSS.

I hope it helps.

Gizem

comments: author: Lakshmi S
body: Thank you for your quick response [@Gizem G?k?e _OBSS_](/t5/user/viewprofilepage/user-id/5319899) . I am looking into this solution.


Tags: automation

data-center

jira-data-center

jql

scriptrunner