===== Behaviours =====
==== Update field's Label, Description and Help Text ====
This can be set under Behaviours' field mapping
def resDescField = getFieldByName("CustomFieldName")
resDescField.setLabel("Set Label Here")
resDescField.setDescription("Set Description Of The Field Here")
resDescField.setHelpText("Set RED Help Text Here")
Reference: [[https://scriptrunner.adaptavist.com/5.4.45/jira/behaviours-api-quickref.html|ScriptRunner]]
==== Verify that assignee for the ticket is within the range of usernames ====
def ticketAssignee = getFieldById("assignee")
def ticketAssigneeValue = ticketAssignee.getValue()
if (!['', 'user1', 'user2'].contains(ticketAssigneeValue)){
ticketAssigneeValue.setError("Sorry, you cannot assign to this user")
} else {
ticketAssigneeValue.clearError()
}