Validators are just like conditions in that they return a true or false value. If TRUE, the user is allowed to compete the transition. If FALSE, the user will not be allowed to complete the transition. However, unlike conditions, a message will be displayed telling the user why they were unable to complete the transition.
Example 1 - Is user in group
assignee = "becky";
Example 2 - Is user in role
createIssue(project, key, "Sub-task", "This is the summary");