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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,461,694
Community Members
 
Community Events
176
Community Groups

How to list ALL open Pull Requests via API?

What is the best way of listing ALL open Pull Requests using the REST v2.0 API?

It seems that you can only do this by iterating through users/projects/repos rather than a single operation to return a list across the whole account.

This looks like it was possible using the old v1.0 API, but this has long since been deprecated.

It is also possible via the UI dashboard - indeed that is this page https://bitbucket.org/dashboard/pullrequests?section=all

Our use case is to process this list and then forward reminders on to users in our Org that they have either a PR open that has been approved and need merging, or a PR that needs reviewing.

This seems like an omission in the API?

3 answers

1 accepted

0 votes
Answer accepted
Norbert C Atlassian Team Mar 14, 2022

Hi Dave,

Let me step in, I'm Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! 

I'd like to inform you that the functionality you're looking for is unfortunately not available yet. We have a feature request for this:

BCLOUD-11980 API: Show Pull Requests for All Repositories

Our development team will give a first-hand update on that ticket if there's any progress made so I would suggest keeping a watch and vote for it.

 

Do note however that there's no ETA on enhancement request, and all enhancements are implemented with this policy in mind: Implementation of New Features Policy

 

Best Regards,
Norbert
Atlassian Bitbucket Cloud Support

Ok Great, thanks - I have voted for that issue.

In the meantime the most efficient model i've found is to iterate by User (we have many more repos than Users) and query for any open PRs they have.

To follow up on this, it seems that iterating through repos rapidly hits the API rate limits - this is exactly why a combined API call makes more sense.

0 votes

Hi @Dave Lewthwaite ,

there's a specific REST API in order to retrieve all pull request for a user https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-pullrequests-selected-user-get

Hope this helps,

Fabio

Sorry, that still requires listing users and then iterating through every user, it's not really any better than iterating through every repo.

Sorry @Dave Lewthwaite , I missed part of your request. I confirm that your follow up is correct.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events