Forums

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

Age of issue (scripted field)

Andrew Striletskyi
Contributor
August 29, 2018

Hello everyone

How to get age of issue (using scripted field - date picker) in the following format : 00:10 (hours:minutes) . I've tried to implement It using this code:

import com.atlassian.core.util.DateUtils

DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().time) / 1000) as Long)


But I get Invalid date in field :( 




1 answer

1 accepted

3 votes
Answer accepted
Nir Haimov
Community Champion
August 29, 2018

If you change the type of the scripted field from "date picker" to "text field" it will give you the result you want.

Your code is fine.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events