I'm having two issues with the script below for my scriptfield "Duration"
- On a dashboard column, my field "Duration" is showing up in what I assume is seconds (24,001,086 ; 86,000,000 ; etc.). I want it to appear in days
- Within the issues themselves, it's displaying as Duration: $DateUtils.formatDurationPretty($value)
I'm very new to scripting, so any help is appreciated
def startedOn
def goLive
def startedOnField = customFieldManager.getCustomFieldObjectsByName('Actual Kickoff Date').getAt(0)
if (issue.getCustomFieldValue(startedOnField))
startedOn = (issue.getCustomFieldValue(startedOnField) as Date).getTime();
def goLiveField = customFieldManager.getCustomFieldObjectsByName("Go Live Date").getAt(0)
if(issue.getCustomFieldValue(goLiveField))
goLive = (issue.getCustomFieldValue(goLiveField) as Date).getTime();
if (startedOn && goLive) {
// Return in Days
return ((goLive - startedOn)/86400).toLong()
}
else {
return 0
}