I'v got a scripted field using ScriptRunner. The script outputs a Long value with ScripRunner useing the Duration template.
The custom field also uses the Duration searcher.
The values in the issues are fine. But querying them with JQL does not work as excpected.
Example:
The field shows this value on an issue: 1 day, 11 hours, 5 minutes
When I search for: myField < 2d the issue is not in the results.
Is it possible to use a duration field in JQL? Or should I use a date field instead?
i Have same issue. Did you solve it somehow?
This more than 2 years ago but I don't tink I found a solution in the end.
Feel free to create a new question for this on the Community.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found an open issue at Adaptavista Jira. So they didin't fix it yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you able to share the link to the issue? Could be useful for anyone else stumbling upon this post :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yah - here it is
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
No I didn't. I chose to use a date field instead.
I don't think we can query duration field but I'm not 100% sure. If you really need it try asking via a vendor support ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the answer :)
It kind of sucks that the official documentation shows examples that do not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm curious too. I'm trying to use the scripted field for "Total time this issue has been In Progress". Are you able to export the data to a CSV containing the custom "Duration" field?
Thanks
Dawn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, I see this note on the scriptrunner docs page. "Use the Duration Searcher. For the template choose Duration." Any idea what this means?
Did you also assign a search term to the field? I found this in their docs.
(Optional) Enter a Search Term if you want to use Scripted Fields when searching for issues with JQL. There are several conditions that must be met for Search Terms, including: they must be unique, case sensitive, and contain no whitespace. Existing search terms/Jira custom field names cannot be used.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.