Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

stereohorse August 21, 2017

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?

2 answers

1 accepted

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

stereohorse August 25, 2017

Thank you, Dave.

Deleted user October 25, 2017

@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

Like Brice Jacquin likes this
Radhika kaur June 28, 2022

Hey @Dave Chevell the solution link shared over  BSERV-9860 is not found. Could you please advise an alternative? I have the same request and need to add default reviewers while creating PRs via API.
 https://developer.atlassian.com/static/rest/bitbucket-server/latest/bitbucket-default-reviewers-rest.html

Like Deleted user likes this
0 votes
Gian Marco Ghiandoni January 19, 2023

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events