Forums

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

Filter for how long a ticket was in a given status

Balázs Gergely
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!
August 15, 2019

Hello

I'm  trying to create a filter that shows if a given, closed ticket was longer then 14 days in a given status. I think it should be possible without a plugin if the ticket goes through predictable statuses. Like Open - Assigned - Closed.

So if it had 14 days in open status it would be like this:

project = test AND status = Closed AND status changed to Assigned AFTER created +14d

And if it had 14 days in Assigned status it would be like this:

project = test AND status = Closed AND status changed to Closed AFTER created +28d
(so technically this case would give the longest time in Open to the ticket, a generosity  thing)

Is there any other way to go about this? Mine might not be the best/only

Similar/same questions, without answer other then get a plugin:

https://community.atlassian.com/t5/Jira-questions/How-to-filter-tickets-that-stayed-in-a-status-for-a-given-time/qaq-p/667961

https://community.atlassian.com/t5/Jira-questions/How-to-track-amount-of-time-spent-in-status/qaq-p/590835

1 answer

0 votes
mfabris
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.
August 16, 2019

If this status is in a linear workflow (so that there is always a certain other status after it) you could use two timestamps and then a calculated field (Scripted field with Scriptrunner) to figure out the time between the two timestamps.

 

For the timestamps, you need to create a custom field of the date and time type and add a post-function to your transactions (both entering and exiting the status) that adds the current date and time.  

 

Then you can create the scripted field in scriptrunner 

The formula would be something like this

long days(Date start, Date end){


if (issue.getCreated()==null || issue.getResolutionDate()==null)
return null;


return days(issue.getCreated(), issue.getResolutionDate())

This actually calculates the time between created and resolved; you will instead have to subtract the time of the custom field 2 to the time of the custom field 1.

 

I would definitely do this.

Pro-tip: calculated field is not a number field, so you might have to copy the value to a real number field if you wanna use it for mathematical functions, like comparison etc.

 

I hope this helps.

 

 

PS: There is also a paid for plugin called time in status that does this.

Balázs Gergely
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!
August 26, 2019

Thank you, sorry for taking this long to respond but I was away when I received your comment.

Thank you again

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events