Hello, using the Bitbucket CLOUD API:
and/or:
Thanks in advance for any pointers!
Welcome to the community @Paolo.Ascari !
I suppose you could fetch the repository or project default reviewer configuration via the Bitbucket REST API [1] and update the pull request with these reviewers [2].
Another option is to use a convenient app like Workzone for Bitbucket cloud [3] where you can configure reviewers or reviewer groups at branch- or even file/path-level and the app will add them automatically when a PR is created. You can also enforce how many approvals you require before the PR can be merged.
Hope that helps, and please let me know if you need any further assistance.
Best, Ulrich
Disclosure: Izymes offers Workzone for Bitbucket Cloud and Server on the Atlassian Marketplace.
Hello Ulrich, and thank you for the detailed reply.
The default reviewers endpoint [1] has proven very useful, so we are going with that.
It's unfortunate that, when creating pull requests, the API doesn't mimic the front-end (i.e. automatically adding default reviewers), which means we always have to call an additional endpoint first.
Personally, I believe that the API endpoint should always add the default reviewers if this field is missing from the payload, as the caller would still have the option to pass an empty array to intentionally obtain the current behaviour.
Cheers, Paolo
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.