Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add a Comment API Bug

Volodymyr
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 31, 2021

Hi,

I was following the documentation while composing the request body and here's the cURL of my request:
curl -X POST 'https://peolyintegromat.atlassian.net/rest/api/2/issue/10001/comment?' -H 'user-agent: useragent/production' -H 'authorization: *** -H 'content-type: application/json' -d '{"visibility":{"type":"role","value":"Administrator"},"body":{"type":"doc","version":1,"content":[{"type":"paragraph","content":[{"text":"paragraph text content","type":"text"}]}]}}'

Here is an example from the docs (https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-rest-api-3-issue-issueidorkey-comment-post):
curl --request POST \ --url 'https://your-domain.atlassian.com/rest/api/3/issue/{issueIdOrKey}/comment' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "visibility": { "type": "role", "value": "Administrators" }, "body": { "type": "doc", "version": 1, "content": [ { "type": "paragraph", "content": [ { "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.", "type": "text" } ] } ] } }'

As you might have noticed my request seems to be valid but I get 400 error "Incorrect comment content.".

It looks like a bug, but maybe someone will find something wrong with my request.
Thanks in advance.

1 answer

1 accepted

2 votes
Answer accepted
Hana Kučerová
Community Champion
March 31, 2021

Hi @Volodymyr

welcome to the Atlassian Community!

I can see you are sending your request to API version 2, the format of the data is for the API version 3. So, please try to send POST request to URL:

https://peolyintegromat.atlassian.net/rest/api/3/issue/10001/comment

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events