Hello,
I'm using JIRA 7 and script runner.
I'm trying to write a groovy script field which will hold a string with the display names of the selected users in a multi-user picker custom field.
I can't figure out how to do it.
Any Ideas?
Community moderators have prevented the ability to post new answers.
Here my code for JIRA 6.4. Hope it is compatible for 7:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.user.ApplicationUser CustomField multiuserCstFld = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Соисполнители") if (multiuserCstFld == null) return "custom field not found" StringBuilder result = new StringBuilder(); for(ApplicationUser user: (ArrayList) multiuserCstFld.getValue(issue)) result.append(user.getName() + "/") return result.toString().substring(0, result.toString().length() - 1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.