Add comments to Pull Requests from API

How to add comment to Pull Request in Stash REST API? REST API Browser doesn't help.

1 answer

1 accepted

This widget could not be displayed.

Hi nfx,

Yeah I'm afraid our REST documentation is lacking at the moment. We are looking to update them in an upcoming release.

To add a comment via REST:

http://host:port/rest/api/latest/projects/$PROJECT/repos/$REPO/pull-requests/$PR/comments

curl -X POST -d '{"text":"your comment"}' $URL

Or if you're replying

curl -X POST -d '{"text":"your comment","parent":{"id":1061}}' $URL

I hope this helps,

Charles

Hello Charles,

I've already figured that out. Somehow. But thank you :)

Btw, Rest Api Browser when used with parameters that are already in URL is totally unusable for playing with API. would you fix that someday?)

Hi nfx,

As I said - we are looking to improve the REST documentation this year. The REST browser will updated alongside Stash as new versions are released.

Charles

I tried this but comments not updated in Bitbucket cloud. There is none of the message displayed and no error. 

Used 2.0 api, the GET comments works fine.

-Kannan

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,528 views 9 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you