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
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Dear all,
I have run the following script from script runner
The userAccountId is retrieved from a UserPicker field
def user = get('/rest/api/2/user/email?accountId='+ userAccountId)
.header('Content-Type', 'application/json')
.asObject(Map).body
return user
The idea is to retrieve the email address of the given Account ID.
What is wierd out of this call of the API is that in the return Json I have no email address key.
In an other hand if I go to the profile of that user, then I can see that its email is correctly set.
Any idea why I cannot retrive the Email adress from my User Picker field ?
From your Atlassian instance go to the email profile visibility setting :
https://id.atlassian.com/manage-profile/profile-and-visibility
Then at the bottom of the page from the Contact section, change your email visiblility to Anyone
I have a better idea to get email id. You can use the below REST request. In this way, you don't need to change the visibility. You can see the documentation here.
This is the response
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.
@Juan Manuel Ibarra , as you can see first is that I am using the API version 2
I mange to find out the reason and it has nothing to do with the API but instead about the security and visibility parameters in the profile section
By changing Email visibility to anyone, the API return correctly the email address in the json response
regards
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.