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

0 votes
Accepted answer
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 Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

655 views 5 9
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