Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I post a pull request comment using BitBucket REST api 2.0?

Using REST API 1.0, I can do the following

POST /api/1.0/repositories/{owner}/{repo}/pullrequests/1/comments

What is the equivalent of this in 2.0? 2.0 documentation for pullrequests resource states "Finally, you can use this resource to manage the comments on a pull request as well." I don't see a POST for comments similar to 1.0 companion; nor does PUT do anything about comments.

Is posting comments on a PR supported in 2.0?

like image 998
WiSeeker Avatar asked Dec 09 '15 17:12

WiSeeker


People also ask

How do I add a comment to a pull request in Bitbucket?

From the pull request you are reviewing, begin by selecting the Start review button in the top, right side of the page. You can also start a review from the comment form by selecting the Start review checkbox. Type your comment and then select Add comment. Add any other additional comments or tasks to your review.

How do you add a comment to a pull request?

On the pull request, click Files changed. Hover over the line of code where you'd like to add a comment, and click the blue comment icon. To add a comment on multiple lines, click and drag to select the range of lines, then click the blue comment icon.

How do I review and approve pull request in Bitbucket?

To review a pull request, select either Approve or Needs work within the header of a pull request. Click the button again or click a different one to change your status. Approving a pull request lets the author know you reviewed their changes and that you feel the work can be merged with the target branch.


2 Answers

I know it has been quite a long time since the question was asked, but for people coming to this post:

Bitbucket finally added a way to post comments using their 2.0 API. You check the documentation for more info.

And here is an example:

curl -X POST -d '{"content": { "raw": "your comment" }}' $URL
like image 108
Savas Vedova Avatar answered Oct 23 '22 17:10

Savas Vedova


Unfortunately pull request comments are currently read-only in 2.0. We are definitely keen to finish that API, but these efforts have been rather under prioritized.

For now, 1.0 remains the only way to mutate PR comments.

Also see: https://answers.atlassian.com/questions/32977327/are-you-planning-on-offering-an-update-pull-request-comment-api

like image 32
Erik van Zijst Avatar answered Oct 23 '22 19:10

Erik van Zijst