Hello, I am trying to create a escalation script that will calculate the number of days an issue has been in the current status based on the last updated date. I am having problems with
a) Getting the last updated date
b) Passing a variable to the issueInputParameters
Any thoughts or suggestions are appreciated. The code snipet is below:
Thank you!
import org.joda.time.Days
import org.joda.time.LocalDate
def days = Days.daysBetween(LocalDate.fromDateFields(issue.getCreated()), LocalDate.fromDateFields(new Date())).getDays()
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'SLA Escalation'}
issueInputParameters.addCustomFieldValue(cf.id, days)