Hi im trying to assign an issue based on a radio button selected but my code is not working. Radio has two options and based on the option selected a different user should be assigned to the issue when the transition happens. Here is what i have done so far in a script editor. Thanks for any help.
IssueManager im = ComponentAccessor.getIssueManager()
MutableIssue issue = im.getIssueObject("SD-....")
ApplicationUser assignee
UserManager umgr = ComponentAccessor.getUserManager()
final customFieldName = "radioCF"
def customFieldManager = ComponentAccessor.customFieldManager
def dot_cf = customFieldManager.getCustomFieldObjects(issue).find { it.name == customFieldName }
def dot_value = dot_cf.getValue(issue)
if (dot_value == "option1")
{
assignee = umgr.getUserByName('user1')
issue.setAssignee(assignee)
} else if (dotyczy_value == "option2") {
assignee = umgr.getUserByName('user2')
issue.setAssignee(assignee)
}