I'm having two issues with the script below for my scriptfield "Duration"
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
}
may be something like this
((goLive - startedOn)) as Long)/ 1000 as long ?: 0L
That didn't seem to work
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.