How to get user email address using BitBucket API?

I'm an administrator of a Bitbucket account. Under my account I've more than 50 repositories and 5 more groups. 

I'm using Bitbucket API to get list of open pull requests. I want to notify the reviewers to take necessary action on the OPEN pull request. For sending notification I need the reviewers email addresses, but I cannot find any API for getting email address from username.

Is it possible to get email addresses of user by using their username? 

3 answers

This is a very basic repository administration feature that most teams want

1 vote

This is so stupid, I added all users by emails - so I know emails, they have created accounts and now I can't see those emails, I have to ask each one what email did they use and some don't even remember, and of course it's hard to find it in chat with every user because I added them several months ago

0 votes

Is it possible to get email addresses of user by using their username? 

No. Email addresses are considered somewhat personal and are not disclosed to other users.

Are you saying even repository(private) admins also don't have permission to get emails of their users?

Like 1 person likes this

That is correct.

Now this approach is far from perfect, as you can look at the commit browser that resolves commits to Bitbucket accounts and then look at the email address in the raw commit object. However, we do not openly disclose user-to-email data).

What if user need to reset the passwd and he's not sure what is the exact email address. or else resetting passwd of a common  checkout user . ho we can see where we get the mail. even site admin cant check the email address?

Finally we moved to Gitlab. And it is offering full admin rights over all users

Like 1 person likes this

Wondering how to achieve following: we have 40 people in our team and need to check whether all of them are using corporate email or not?

Or this one - we have email addresses for each team and wish to know how do they perform, but without knowing their bitbucket usernames it is not possible

It is impossible with cloud, we have turned on SAML 2.0 in Jira to ensure that future users are signing up with Corporate mail but there is no way for us to tell with existing. We are also trying out bitbucket server to see if this could be a better option. 

Yes I understand that just wish to show few more use cases when this might be required. I do respect user privacy, but we are talking here for closed teams where we already do know everything about people in teams so hiding their emails seems like a pretty strange step. May be it is possible to show emails for private team members or something like this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

247 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you