Hi,
I'd like to get the assignee name changed as we transition in the workflow. We tried script runner and some example script below. But it gives us error.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
String userName;
def csProduct = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("components")
switch(issue.getCustomFieldValue(csProduct)){
case "Clock Tree": userName = "abc";break;
case "Database": userName = "xyz";break;
}
log.error(userName)
log.error(issue.getCustomFieldValue(csProduct));
issue.setAssignee(ComponentAccessor.getUserManager().getUserByName(userName))