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

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

716 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot