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))
Maybe I don't understand the use case here but if you are using Components you can set the component lead thereby ensuring that any issues will get set to the proper person based upon the component selected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.