Hello Everyone,
I want to set the first selected user in the list of Multi-User picker as the value of Assignee field. I used in built post function of JSU (JIRA Suite Utilites plugin) and the below code in custom script post function:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def uatTesters = customFieldManager.getCustomFieldObjectsByName("UAT Testers").first()
if(issue.getCustomFieldValue(uatTesters)) {
List<ApplicationUser> uatTestersVal = (List<ApplicationUser>) issue.getCustomFieldValue(uatTesters)
issue.setAssignee(uatTestersVal[0]) }
Both methods result in populating Assignee field with the user whose Full Name has alphabetical precedence. How can I set the assignee field with the first selected user in list.
Any help would be appreciated. Thanks in advance.