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

1 vote
Answer 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 Sign up to answer
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

257 views 0 12
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