I want to personalize the list of the field "Assignee", depending on the transition, using ScriptRunner.
Example:
-Create Issue: Assignee Lists users from a role I have set previously.
-Issue after the first transition: Assignee Lists users from ANOTHER role I have set previously.
I've tried to set the list of the field from a List<String> but it doesn't work.
Here's the example code:
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
//user list
//Set<ApplicationUser> assigneeList;
List<String> assignableList;
def myName = currentUser.getUsername();
assignableList.add(myName);
getFieldById(ASSIGNEE).setFieldOptions(assignableList);