Hello,
I have a requirement to auto assign issues based on a cascading list custom field. This will be executed on the create transition post function. I would like to use Scriptrunner, as we already own it. I have tried a few different suggestions from other community posts, but cannot seem to get any of them to work. I have placed this post function last in the list. Here is the script I am currently attempting to use:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
String user;
def cfManager = ComponentAccessor.getCustomFieldManager();
def cf = cfManager.getCustomFieldObjectByName("New Product");
switch(issue.getCustomFieldValue(cf) as String){
case "1": user = "user1";break;
case "2": user = "user2";break;
case "3": user = "user3";break;
}
issue.setAssignee(ComponentAccessor.getUserManager().getUserByKey(user))
Is there something different that I need to use for a cascading field?
Any suggestions you might have would be greatly appreciated. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.