Forums

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

Listener to find amount of time a ticket spent in the Clarification status

Dayanand
Contributor
June 22, 2021

Looking for script runner Listener to find amount of time a ticket spent in the Clarification status so that it will store in databases (we dont want to use time in status field or scripted field since they are not store in jira DB).

3 answers

1 accepted

1 vote
Answer accepted
Vikrant Yadav
Community Champion
June 28, 2021

Hi @Dayanand  You can do one thing , use scripted field to calculate time in a particular status using below link and copy the value of the scripted field to a custom field using post function.

https://library.adaptavist.com/entity/count-the-time-an-issue-was-in-a-particular-status

 

Thanks

Vikrant Yadav
Community Champion
June 28, 2021

Script to Copy scripted field value :- 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue

def customFieldManager = ComponentAccessor.getCustomFieldManager()

MutableIssue issue = issue

def cf = customFieldManager.getCustomFieldObjectByName("Scripted Field")
issue.description = cf.getValue(issue)
0 votes
ali jawad
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!
June 24, 2021

Now not quantity of time in reputation, length of time in popularity what we're searching and we are searching a solution wherein that custom discipline fee could be present in jira database.

Dayanand
Contributor
June 24, 2021

@ali jawad ,

 

Yes Looking for script runner Listener to find amount of time a ticket spent in the Clarification status

0 votes
Olga Videc
Community Champion
June 23, 2021

Hello @Dayanand 

You need an app for that ScriptRunner for example.

Just go to Settings -> Apps ->ScriptRunner console -> Fields -> add custom field -> this filed will be pre-defined -> Add

https://scriptrunner.adaptavist.com/6.5.0/jira/script-fields/no-of-times-in-status.html

BR, Olga

Dayanand
Contributor
June 23, 2021

@Olga Videc ,

Not number of time in status, Duration of time in status what we are looking and we are looking a solution where that custom field value will be present in jira database.

Suggest an answer

Log in or Sign up to answer