Is it possible to reply to a pull request comment via Bitbucket API 2.0? If so, how?

Steve Muskiewicz April 2, 2019

Related to this question, I am using the Bitbucket 2.0 API to post a new pull request comment, but it is not clear (to me at least) how/if I can make the new comment a reply to a previous comment.

I have tried adding

 { "parent": { "id": <commentID> } }

and (what used to work in API 1.0)

{ "comment_id": <commentID> }

to my JSON data but both of these when done via CURL give me a response such as:

{"type": "error", "error": {"fields": {"content": "required key not provided",
"{ \"content\": { \"raw\": \"This is a reply comment\" }, \"parent\": { \"id\": \"NNNNNNNN\" }}":
"extra keys not allowed"}, "message": "Bad request"}}

I would think that the first example should work since if I query a PR comment that is a reply comment, the API shows it as having a parent.id key.

If there is some other required key then the error response isn't very helpful about what that should be.  And the API docs really offer no clue as to where the parent comment ID needs to be specified in the request body.

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events