How to use a duration field in Issue Search

SMAtlassianMber October 2, 2018

I created a new ScriptRunner Script Custom field for "Days in Current Status" using the Duration Template, but when I try to use this field in my Issue Search nothing works. What is the correct format for a duration field? 

Ex. Displays on Jira Issue - 1 year, 18 weeks, 6 days, 18 hours, 12 minutes

I would like to search for issues over 5 days

"Days in Current Status" ~ '>=5days'

2 answers

0 votes
Pavel Abdi December 16, 2019

Hi everyone,

I can't get the Duration search work correctly. I set up a Script Field to calculate time in progress as described here https://scriptrunner.adaptavist.com/latest/jira/scripted-fields.html#_total_time_this_issue_has_been_in_progress

The displayed value seems to be correct. However, when I try to search by the script field it shows incorrect results. For example, the search "Time in progress" > 2d" also showed an issue with the value "1 day, 1 hour, 56 minutes".

What am I doing wrong?

SMAtlassianMber December 16, 2019

There is an outstanding Bug regarding scriptrunner and duration fields.  - https://productsupport.adaptavist.com/browse/SRJIRA-3215

Pavel Abdi December 16, 2019

@SMAtlassianMber Thank you for pointing this out to me.

0 votes
JP _AC Bielefeld Leader_
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.
October 3, 2018

Hi Shelli,

maybe a bit far off, but we use something like:

status changed after "-5d"

without the use of a custom field.

Best

JP

SMAtlassianMber October 3, 2018

Thank you JP. That is very helpful, but I would still like to figure out how to use the actual field. 

Suggest an answer

Log in or Sign up to answer