Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

python: Would like to get a list of all outstanding review requests for my organization

soualline
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!
November 4, 2022

for each repo owned by my company

     get a list of open pull requests

          get a list of reviewers for that request that have not approved the pull request

                 print results

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 7, 2022

Hi @soualline and welcome to the community.

You can use the following endpoints:

The last call has the info you need on approvals and reviewers. The object participants includes PR reviewers and the field participants.approved shows as true or false depending on whether the participant approved the PR or not. Please keep in mind that participants will include also non-reviewers who may have approved the PR. The field participants.role will tell you if the participant is a reviewer or not.

I am not familiar with Python, but an example request with curl that returns participant name, role, and approval status is the following:

curl -u BitbucketUsername:AppPassword https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/pullrequests/2?fields=participants.user.display_name,participants.role,participants.approved

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events