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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.