Hello Bitbucket team,
I need to get a pull request 's reviewers that approved the pull request. Could you please advise how to do it using bitbucket rest API 2.0?
G'day Iuliia!
Welcome to the Bitbucket Cloud Community! :)
This page here will advise you on how to list information about a certain pull request based on the pull request ID (this can be found at the end of the URL on the pull request or in the UI):
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get
To authenticate with the /2.0/repositories endpoint, you will first need to configure an AppPassword - a guide for setting this up can be found here:
https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/
For example - this cURL command will give you information about the pull request, including a list of the reviewers on that pull request along with their role:
curl --request GET \
--url https://api.bitbucket.org/2.0/repositories/{workspaceID}/{reposlug}/pullrequests/{id} \
--user {username}:{AppPassword}
NOTE: You will need to remove the curly braces and replace workspaceID, reposlug, id, username, AppPassword with actual values.
Hope this helps.
Cheers!
- Ben (Bitbucket Cloud Support)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.