We have purchase Script Runner Addon and we would like to have an Age column using Scripted field.
Currently we are using the script below but the returned format is long (e.g. 25w 3d 14h 9m) and we would like to have it in days only.
Can you please assist how to tweak the script in order to gain this result ?
import com.atlassian.core.util.DateUtils DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().time) / 1000) as Long)
import org.joda.time.Days import org.joda.time.LocalDate int days = Days.daysBetween(LocalDate.fromDateFields(issue.getCreated()), LocalDate.fromDateFields(new Date())).getDays()
but calculated field are not good for temporal data - the value is only reindexed when the issue is updated, which means you can't query on them properly.
Random, the value was supposed to be 11 and it was changing all the time 4,6,5,7.
Once I took once of the tickets and used it on the preview on the scripted Field form it calculated the right value.
However, when I got back to JIRA filter it was again random.
I changed the script to the one @Jamie Echlin [Adaptavist] provided and it fixed the value for all (I think it just refreshed all the values not that the logic on your script is incorrect)
If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot