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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, that still requires listing users and then iterating through every user, it's not really any better than iterating through every repo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry @Dave Lewthwaite , I missed part of your request. I confirm that your follow up is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.