I'm using a Behaviour to set a different default assignee on the Create screen, if a certain custom field (radio button) value is picked.
This works fine, but I want the behaviour to change the assignee back to "Automatic" if the same custom field is changed again. I can't get this part to work, having tried various different things in setFormValue (including "automatic", "-1", null).
Here's my server side script:
import static com.atlassian.jira.issue.IssueFieldConstants.ASSIGNEE
def raisedfromField = getFieldByName("Raised From")
if (raisedfromField.getValue() == "Support") {
// Set assignee to SJM
getFieldById(ASSIGNEE).setFormValue("supportjiramanager")
}
else {
// Set assignee back to "Automatic", in case user picks Support
// and then changes their mind
getFieldById(ASSIGNEE).setFormValue("-1")
}Any ideas?