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.
use this for linux:
curl -u user:passwd -H "Content-Type: application/json" -X POST -d '{"text":" message "}' 'https://bitbucket.xxx.com/rest/api/1.0/projects/xxxx/repos/xxxx/pull-requests/<pr number>/comments'
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.