I have created a Behaviour to update the Priority based on two custom fields, Impact & Urgency (both are Select Fields).
However, one slight glitchy thing is when I change Impact & Urgency the Priority won't update at first on the issue. I have to go back into 'Edit' and hit 'Update' again for it to trigger the Priority change based on the Behaviour.
My behaviour code is below:
FormField fimpact = getFieldByName("Impact")
FormField furgency = getFieldByName("Urgency")
FormField fpriority = getFieldById(getFieldChanged())
FormField fpriority0 = getFieldById("priority-field")
String Imp = (String) fimpact.getFormValue()
String Urg = (String) furgency.getFormValue()
if (Imp == "10800" && Urg == "10803") {
fpriority.setFormValue("1")
} else if (Imp == "10800" && Urg == "10804") {
fpriority.setFormValue("2")
} else if (Imp == "10800" && Urg == "10805") {
fpriority.setFormValue("3")
} else if (Imp == "10801" && Urg == "10803") {
fpriority.setFormValue("2")
} else if (Imp == "10801" && Urg == "10804") {
fpriority.setFormValue("3")
} else if (Imp == "10801" && Urg == "10805") {
fpriority.setFormValue("4")
} else if (Imp == "10802" && Urg == "10803") {
fpriority.setFormValue("3")
} else if (Imp == "10802" && Urg == "10804") {
fpriority.setFormValue("4")
} else if (Imp == "10802" && Urg == "10805") {
fpriority.setFormValue("5")
}