Hi,
I want to get a list of all active users with username and email address from a specific group in jira. Trying to run this scirpt through script Runner console, any suggestions on how to get email address too? i pulled a list with just usernames.
Hi @Spruha Shah
could you share your code? This would make it easier to analyze the problem.
How do you get the user names? do you only get a list of strings with the names or do you get a list of user objects?
Generally the user object has an email property and you can get this from a user object variable eg. ‚user‘ as follows:
user.getEmailAddress()
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
groupManager.getUsersInGroup
Returns a collection of user objects of the users in the group. If you add a .getEmailAdress() it will return the email of all users.
The following script should do the work:
import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
String groupName = "jira-software-users"
groupManager.getUsersInGroup(groupName).getEmailAddress()
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.