You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.