Hello,
I am trying to write a script for script runner behaviors for the request below;
If the Risk Level custom field is high, due date will be auto selected 7 days from ticket created
If the Risk Level custom field is medium, due date will be auto selected 30 days from ticket created
If the Risk Level custom field is low, due date will be auto selected 90 days from ticket created
I am not familiar with script writingas you can see and here is what I have came up with.
Could you please help me with it since it does not work?
def RiskLevelfield= getFieldByName("Risk Levels")
def DueDate = getFieldByName("Due Date")
def RiskLevel = RiskLevelfield.getValue() as RiskLevel
if (RiskLevel.name == "High") {
issue.setDueDate(new Timestamp((issue.dueDate + 7).time))
if (RiskLevel.name == "Medium") {
issue.setDueDate(new Timestamp((issue.dueDate + 30).time))
if (RiskLevel.name == "Low") {
issue.setDueDate(new Timestamp((issue.dueDate + 90).time))
}}}
else {
}
Thank you so much!