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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.