We are checking the feasibility of retrieving the email IDs of the PR reviewers and approvers for us to send post-deployment notification emails from Jenkins.
Please confirm if there are any APIs available for the same.
On Atlassian cloud, each user can decide whether his/her email address is visible. It is part of his account settings. If he/she makes it invisible, then the API will not return this field, either! If it is set visible, then the end-point that returns the user account details will return it.
Also, there is a dedicated Email API which will return the email address even if the user set that invisible. But it is open only for those apps/integrations for whom Atlassian approves the access.
Hello @sumit_k_pal_pwc_com and thank you for reaching out to Atlassian Community!
Just adding to @Aron Gombas _Midori_ response, currently, the Bitbucket Cloud API does not return a field containing the user's email due to privacy reasons.
You can use the Get a Pull Request API to fetch the information of reviewers and approvers, but it will not contain the email address:
curl -X GET -u BB_USERNAME:APP_PASSWORD https://api.bitbucket.org/2.0/repositories/<Workspace>/<Repository>/pullrequests/<Pull Request ID>?fields=reviewers,participants
The example above will return the reviewers and participants (approvers) of a given Pull Request, including their Public Name, Bitbucket UUID (uuid field), and Atlassian Account ID ( account_id field).
We do have an existing feature request to return email addresses on Bitbucket Cloud APIs:
We encourage you to Vote for that feature to give it traction, so our developers can understand the interest. Also, feel free to add yourself as a Watcher to receive first-hand updates on that feature.
However, while that feature is not available, if you are an Org Admin and want to get the email from managed users under your organization, this is possible using the Organization's API below:
This API will also include the email address of the managed users. You can use this API in combination with Bitbucket API to match the account_id on both of them and find out the user's email.
Thank you, @sumit_k_pal_pwc_com !
Patrik S
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.