Hi everyone,
I'm a newbie with groovy script and ScriptRunner.
I search a script in Post fonction to set the due date regarding the priority field value.
I have found some examples but they doesn't work.
The first example I've found is :
def dueDateField = issue.dueDate
def Sev = issue.priority
def dateToSet
if (Sev == "Critical") {
dateToSet = new Date() + 1
} else if (Sev == "Hight") {
dateToSet = new Date() + 5
} else if (Sev == "Medium") {
dateToSet = new Date() + 20
} else if (Sev == "Low") {
dateToSet = new Date() + 30
} else if (Sev == "Lowest") {
dateToSet = new Date() + 90
}
issue.setDueDate(dateToSet)I have put it into the Custom ScriptRunner Post Fonction of creation transition.
I can save it without error and no failure when the script is running but the field Due date stay empty.
Do you have any idea ?
Thanks for your answer.
I work on Jira Software 8.3.4 with ScriptRunner 5.9.1-p5.