The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to list ALL open Pull Requests via API?

Dave Lewthwaite
March 8, 2022

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 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

Dave Lewthwaite
March 14, 2022

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.

0 votes
Dave Lewthwaite
March 9, 2022

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
Fabio Racobaldo _Catworkx_
Community Champion
March 8, 2022

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

Dave Lewthwaite
March 9, 2022

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

Fabio Racobaldo _Catworkx_
Community Champion
March 9, 2022

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

TAGS
AUG Leaders

Atlassian Community Events