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

curl PUT command removes the reviewers from pull-request while trying to edit the description.

MOHAN SATYA SAI BHAVANI PRASAD. REDDY
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!
June 22, 2018

I am using a curl PUT command to update the pull-request description. It is updating the description but removing the existing (already added) reviewers. 

Following is the curl command I am using to update the pull-request description.

command:

curl -s -X PUT -u '<username>':'<password>' -H "Content-Type: application/json" -v -d '{"version": 1, "description": "'"should go together"'"}' https://<bitbucket.com>/rest/api/1.0/projects/<project_key>/repos/<repo_slug>/pull-requests/<pull_request_id>

Please help.

1 answer

0 votes
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2018

Hi @MOHAN SATYA SAI BHAVANI PRASAD. REDDY,

According to the REST API endpoint documentation, this is the expected behaviour and I just confirmed that this is the case in my test environment.

the reviewers list may be updated using this resource.

Since the payload accepts the list of reviewers as input, you could read the current ones and add them to the PUT request to update the description.

 

Cheers,

Caterina - Atlassian

Nicholas Williams October 28, 2022

Caterina,

The documentation says the "reviewers" list may be updated. It does not say it must be included. It sounds like there's a bug, either in the API endpoint (missing "reviewers" key in request should not remove all reviewers) or the documentation (may should be replaced with must).

What other keys must be included? Do I have to include every key that we aren't changing from the API? Or just the "reviewers" key? It seems like many things couldn't be changed this way ("createdDate", "updatedDate", "open", "closed", "state", "author", "links", etc.). So could we get a definitive list of which keys must be included (to keep from wiping the field) and which keys can't be included (here and in the documentation)? The documentation doesn't even say that the "version" key is required, but it is. It's very confusing and makes this endpoint very difficult to accurately use.

Thanks,

Nick

First Last
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!
September 5, 2023

Caterina _or Kate_ Curti is likely not with Atlassian anymore, but the comment above is a complete nonsense.

the reviewers list may be updated using this resource.

Means that it's possible to update reviewers with this endpoint explicitly, not that it might be updated for you under the hood. This is generally my experience with Atlassian API - they don't know how it should be working in a first place. And of course, it's impossible to fix anything because of compatibility etc. Just stay away from it, use something else.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events