Hi,
i have simple script sending users in group to an array and then displaying using for() loop.
String list = ComponentAccessor.getGroupManager().getUserNamesInGroup("somegroup").toString();
String list2 = list.substring(1, list.length() - 1);
String[] array = list2.split(",");
problem is that script displays username not full display name. i was trying with getDisplayName() function but with no result
could you help me?
Hi @Kamil Mikołajczyk the following script will do what you need:
import com.atlassian.jira.component.ComponentAccessor
def applicationUsersList = ComponentAccessor.getGroupManager().getUsersInGroup("jira-administrators")
def applicationUsersDisplayNames = applicationUsersList.collect{ it.getDisplayName() }
Can you try this method
getUsersInGroup()
https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/security/groups/GroupManager.html
instead of
getUserNamesInGroup()
Then you will have a collection of ApplicationUser and make a loop and use this
methodgetDisplayName()
https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/user/ApplicationUser.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Trying to collect the same info, but nothing seems to work for getting display name.
Attempts below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.