On the Create Issue screen, I'm using an Initializer function to dynamically change the default FormValue of Assignee based on Issue Type.
This is working fine when I use actual users, but I'm unable to set the FormValue of Assignee back to the "Automatic" option (which has a value of -1)
This works:
getFieldById(ASSIGNEE).setFormValue("bobparker")This doesn't work:
getFieldById(ASSIGNEE).setFormValue("-1")
Full code is below:
import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import static com.atlassian.jira.issue.IssueFieldConstants.*
if (getActionName() != "Create Issue") {
return
}
getFieldById(ASSIGNEE).setFormValue("-1")