How to add existing default reviewers when creating pull request with API?

We are using this API endpoint to set default reviewers for our repositories. It works as expected and corresponding settings appear at UI.

 

But when we create pull requests using this API endpoint, these default reviewers are not added implicitly.

 

Is that expected behaviour?

1 answer

1 accepted

This widget could not be displayed.
Dave Chevell Atlassian Team Aug 23, 2017

Hi Viet,


This is totally expected behaviour. Check out BSERV-9860, where one of the Bitbucket Server dev team responded to a similar request.
The tl;dr reason is that default reviewers are suggested, not enforced. Even when creating a PR via the UI, default reviewers can be removed before creating the pull request.


If you need to include them on PR's created via the API I'd recommend retrieving the default reviewers via this api so you can then include them when creating the PR.


Cheers,


Dave Chevell

Thank you, Dave.

@Dave ChevellIs this the endpoint you would suggest to access all default reviewers for a particular repo/source branch/target branch?

/rest/default-reviewers/1.0/projects/{projectKey}/repos/{repositorySlug}/reviewers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,320 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you