Add new comment on issue not setting comment text

Issue #13279 resolved
Namma created an issue

we have been using the APIs for comment on issue, push and pull request. the content parameter is set as application\json payload, which used to work fine for all three, but from yesterday we are seeing that this is not setting the comment text for issues. On sending the content as url encoded form parameter i was able to resolve the issue.

Was there a change to move to url encoded param? I dont see anything specific in the documentation..

Comments (6)

  1. Erik van Zijst

    Which API endpoint are you using? And could you provide me with a command (using curl for instance) that demonstrates the problem?

  2. Namma reporter

    https://confluence.atlassian.com/bitbucket/issues-resource-296095191.html#issuesResource-POSTanewcommentontheissue is the api i am using,

    curl -X POST -H "Authorization: Basic bmFtbWFmdW50ZWFtQG91dGxvb2suY29tOmV4cGxvcmVAc2xhY2s=" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 874f9c3c-fe06-5159-db21-42c23b42cf1e" -d '{ "content": "Hello World :) :) " }' "https://api.bitbucket.org/1.0/repositories/nammafunteam/idcdemorepo/issues/19/comments"

    is not setting the comment text, response is

    { "content": "", "author_info": { "username": "nammafunteam", "first_name": "Namma", "last_name": "", "display_name": "Namma", "is_staff": false, "avatar": "https://bitbucket.org/account/nammafunteam/avatar/32/?ts=1473827716", "resource_uri": "/1.0/users/nammafunteam", "is_team": false }, "comment_id": 30576048, "utc_updated_on": "2016-09-14 05:05:29+00:00", "convert_markup": false, "utc_created_on": "2016-09-14 05:05:29+00:00", "is_spam": false }

    when i set it as url form encoded param its setting correctly. curl -X POST -H "Authorization: Basic bmFtbWFmdW50ZWFtQG91dGxvb2suY29tOmV4cGxvcmVAc2xhY2s=" -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -H "Postman-Token: 1b1635cc-735c-e20d-c0e5-077370f62953" -d 'content=Hello World :) :) ' "https://api.bitbucket.org/1.0/repositories/nammafunteam/idcdemorepo/issues/19/comments"

    Response { "content": "Hello World :) :) ", "author_info": { "username": "nammafunteam", "first_name": "Namma", "last_name": "", "display_name": "Namma", "is_staff": false, "avatar": "https://bitbucket.org/account/nammafunteam/avatar/32/?ts=1473827716", "resource_uri": "/1.0/users/nammafunteam", "is_team": false }, "comment_id": 30576088, "utc_updated_on": "2016-09-14 05:09:07+00:00", "convert_markup": false, "utc_created_on": "2016-09-14 05:09:07+00:00", "is_spam": false }

  3. Erik van Zijst

    Sorry for not getting back sooner. I had a look at the code and contrary to pull request comments, it looks like issue comments in the 1.0 API never supported application/json, only application/x-www-form-urlencoded.

    I've created a quick fix however that should go in next week.

  4. Log in to comment