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,559,413
Community Members
 
Community Events
184
Community Groups

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

Edited

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 _or Kate_ Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 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

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events