I've been trying to script out 'posting a comment' to PR's in my repo as the final stage in our testing workflow.
Here's the cURL command I'm using:
curl -H "Content-Type: application/json" \ -X POST \ -d '{"content": {"raw": "sample text"}}' \ 'https://api.bitbucket.org/2.0/repositories/{my_username}/{my_repo_slug}/pullrequests/1/comments'
Unfortunately, I've been getting a 500 server error returned from this:
{"type": "error", "error": {"message": "Something went wrong", "id": "108609ba088f47e98f70a1b119088765"}}
For test purposes, my repo is public so there are no authentication issues at all.
Am I missing anything? I have attempted a similar thing using the deprecated 1.0 API and got the same error.
Link to API documentation
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/comments?_ga=2.1079224.803810173.1549879103-1540948770.1548946271
Threads I've looked at so far
https://community.atlassian.com/t5/Answers-Developer-Questions/Are-you-planning-on-offering-an-update-pull-request-comment-API/qaq-p/526892
https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-Cloud-REST-API-v2-0-Commenting-on-Pull-Requests/qaq-p/847107
FYI - I don't think I have enough reputation to reply more than every 24h so please give me an alternative way to respond to you.
Update This is now working fine. It looks like the 500 Server Error was indeed a problem on the server-side.Does anyone know what might have caused it / how frequently these issues should be anticipated?
It looks like you're new here. Sign in or register to get started.