You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
How to add comment to Pull Request in Stash REST API? REST API Browser doesn't help.
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?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charles,
Can you let me know what is $PR in hyperlink format you have provided
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI All ,
Getting the below error when trying to add the commnet to a PR as
curl -k -u ******:***** -X POST -d '{"content": { "raw": "your comment" }}' https://api.bitbucket.org/2.0/repositories/**/********/pullrequests/1/comments
"type": "error", "error": {"fields": {"content": "required key not provided", "{\"content\": { \"raw\": \"your comment\" }}": "extra keys not allowed"}, "message": "Bad request"}
Any idea what am i missing here
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had to add `Content-Type: application/json` to headers, not the URL. Maybe either is good enough.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone, We are looking to learn more about development teamsā workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.