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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,801
Community Members
 
Community Events
176
Community Groups

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?

2 answers

1 accepted

0 votes
Answer accepted
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

Like Brice Jacquin likes this

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 thomas_v_judkins likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events