I created a scripted field called Severity which returns a value from 1-5 based on Impact and Urgency. I now want to update the JIRA default Priority field with the Severity value (and just hide the Severity field).
I am looking at the Behaviours Plugin. I've created a Behaviour and using fields Priority and Severity, with Severity as readonly. I've mapped the Behaviour to all issue types and all projects. Below is the serverside script attached to the Priority field.
FormField severity = getFieldById("customfield_11302")
FormField priority = getFieldById("priority")
if (severity.getValue() == 1) {
priority.setFormValue("1")
}
else if (severity.getValue() == 2) {
priority.setFormValue("2")
}
else if (severity.getValue() == 3) {
priority.setFormValue("3")
}
else if (severity.getValue() == 4) {
priority.setFormValue("4")
}
else if (severity.getValue() == 5) {
priority.setFormValue("5")
}
This is not working. Any ideas on how to get this working? Or a better method?
Other small changes I've tried is severity.getFormValue() and even enclosing the severity values in "". None have any change.