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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.