Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update the list of existing default reviewers in a bitbucket repository?

Saranya Varathanarayanan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 2, 2019

Hi,

I am trying to build a jenkins job for tech leads to manage their default reviewers.

I am trying to update the list of default reviewers for a repository using this api call

curl -X POST -H 'Content-Type: application/json' -u username:password http://bitbucket-url/rest/default-reviewers/1.0/projects/LEAR/repos/snarayananrepo/condition --data-binary '{"sourceMatcher":{"id":"any","type":{"id":"ANY_REF"}},"targetMatcher":{"id":"refs/heads/'"$BRANCH_NAME"'","type":{"id":"BRANCH"}},"reviewers":['"$payload"'],"requiredApprovals":"1"}'

 

https://docs.atlassian.com/bitbucket-server/rest/5.3.0/bitbucket-default-reviewers-rest.html 

PUT removes removes the existing approvers, POST adds a new condition for the same branch instead updating the same condition matching and the last entry for the condition is picked up during pull request).



But everytime I do this, it creates a new entry in the defaults reviewers, instead I want to update the existing list of dafault reviewers. can someone please suggest how do I do that

 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events