Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

[bitbucket rest API 2.0] get a pull request 's reviewers that approved the pull request

Iuliia Gapon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 27, 2022

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?

2 answers

1 accepted

2 votes
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 28, 2022

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)

0 votes
abuislam September 3, 2024

o retrieve the list of reviewers who approved a pull request using the Bitbucket REST API 2.0, you can use the endpoint for fetching pull request details. Specifically, you can query the pull request’s approvals to get the information about reviewers who have approved it.

You might use the following endpoint: GET /2.0/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/approve

This will provide the details of the users who have approved the pull request. For further guidance, you might refer to the Bitbucket API documentation or community forums for additional support.

May Allah make it easy for you and grant you success in your work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events