Forums

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

REST API endpoint to add reviewers to an open PR

Eddie Bickel
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!
November 18, 2024

Looking how I can update an already open pull request by adding a reviewer group to the pull request. I tried using 

<baseurl>/{repo_slug}/pull-requests/{pull_request_id}

However it seems when I run this endpoint in postman it is looking for version as well... 

{"errors":[{"context":null,"message":"version must be supplied for this request","exceptionName":null}]}

I am passing this in the body..

{ "reviewers": [ { "account_id" : "<my reviewer group>" }]}

Where can I add the version or is there an easier way. 

(fyi..eventually I plan in writing this in a python function.)

1 answer

1 vote
Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
November 18, 2024

 

To add reviewers to a pull request in BB DC you can use the update pull request RESt endpoint and simply add the "reviewers": [..] element together with the id and version elements.

You need to fetch the current PR status first to obtain the current version.

Happy Coding

Ulrich

// Izymes

 

Eddie Bickel
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!
November 19, 2024

Thanks! However it now seems I am getting this error..

{"errors":[{"context":null,"message":"reviewers[0].user must be supplied for this request","exceptionName":null}]}

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events