We have a requirement for the Assignee field to have an Assignee in all statuses and all issue types except for the initial status. To avoid having to add a Field Required (JSU) Validator to each and every transition (which would still allow blanking out the Assignee when the issue is static), we implemented a Behaviour:
// Make Assignee field required
import static com.atlassian.jira.issue.IssueFieldConstants.*
// Field is not required during Create
if (getActionName() != "Create"){
// Field is not required in an initial status
if (!(underlyingIssue.getStatus().getName() in ["Backlog","Triage"])){
getFieldById(ASSIGNEE).setRequired(true)
}
}
However, even though the field now appears Required, and it does not accept selecting Unassigned, it still allows being blanked out, which results in the issue being Unassigned.
It appears a blank field corresponds to "Automatic", which the Behaviour accepts as a non-blank value, and "Automatic" results in a value of "Unassigned" in our projects.
Is there any way to get this to work properly?