Forums

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

Automatically populate the value in field with the number of times the ticket was re-opened

Lakshmi CH
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.
April 21, 2022

Hi Team,

How to automatically populate the value in field with the number of times the ticket was re-opened.

 We have Script runner and JMWE and JSU addon

 

Thanks!

4 answers

0 votes
Lakshmi CH
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.
April 26, 2022

Hi Team, Thank you for all your quick responses. I found this in script runner scripted fields. Here you can count the number of times in status.

no of times in status.PNG

0 votes
Emre Toptancı _OBSS_
Atlassian Partner
April 22, 2022

Hello @Lakshmi CH

A solution that does not include scripts and/or custom fields would be easier to maintain and put less load on your Jira. If you are interested in such an alternate solution, our team at OBSS built Timepiece - Time in Status for Jira for this exact need. It is available for Jira Server, Cloud, and Data Center.  

Time in Status mainly has status-based duration reports but the app also has count reports that show how many times each Status and each Transition was used.

TransitionCount.png  StatusCount.png

For all numeric report types, you can calculate averages and sums of those durations grouped by the issue fields you select. For example total in-progress time per customer (organization) or average resolution time per sprint, week, month, issuetype, request type, etc. The ability to group by parts of dates (year, month, week, day, hour) or sprints is particularly useful here since it allows you to compare different time periods or see the trend.

tisCloud_StatusDuration_LeadTime_Average_TimeGrouped.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. It supports both Company Managed and Team Managed projects.

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

And the app has a REST API so you can get the reports from Jira UI or via REST.

Gadget_AverageStatusDurationByComponent.png  tisCloud_StatusDuration_LeadTime_Chart.png

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

Timepiece - Time in Status for Jira

EmreT

0 votes
David Fischer
Community Champion
April 21, 2022

Hi @Lakshmi CH 

an alternative to a ScriptRunner scripted field (which requires a script that you'll need to maintain), you could use a Transition Count custom field from JMCF.

0 votes
Anzar
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.
April 21, 2022

Hi,

You can solve this by making a scripted field in script runner, the code shall look like this:

import com.atlassian.jira.ComponentManager
def componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
Double counter=0
changeHistoryManager.getChangeItemsForField(issue, "status").each{
if (it.toString=="Reopened")
{
counter=counter+1
}
}

return counter

Let me know if that solves your problem.
Regards,

Anzar Khan

Suggest an answer

Log in or Sign up to answer