Details
-
Bug
-
Resolution: Not a bug
-
Medium
-
Severity 3 - Minor
-
Description
Issue Summary
The REST API endpoint Get inline comments for page (GET /pages/{id}/inline-comments) is not returning the inline comments body unless you provide the parameter body-format (possible values: storage or atlas_doc_format).
This is not working as expected since:
- As shown in the example in the endpoint documentation, the inline comments body should always be returned.
- The the very similar endpoint Get inline comments for blog post (GET /blogposts/{id}/inline-comments) always returns the inline comments body with no need to add extra parameters, as documented.
Steps to Reproduce
- Call the REST API endpoint to get inline comments from a page without appending the body-format parameter to the REST API request URL.
Expected Results
The inline comment(s) body is returned in the response.
Actual Results
There is no body value returned at all, it is totally missing like in below example:
- Request URL: https://xxxxxx.atlassian.net/wiki/api/v2/pages/xxxxxx/inline-comments
- Response Body:
{ "results": [ { "id": "XXXXX", "status": "current", "title": "Re: A simple introduction to REST", "pageId": "XXXXX", "version": { "number": 1, "message": "", "minorEdit": false, "authorId": "XXXXXXXXXXXXXXXX", "createdAt": "2018-03-29T09:57:30.440Z" }, "resolutionStatus": "open", "properties": { "inlineMarkerRef": "bf10d939-f3c4-4d7d-a291-5dd217c17c0e", "inlineOriginalSelection": "you will need to temporary change the user password", "inline-marker-ref": "bf10d939-f3c4-4d7d-a291-5dd217c17c0e", "inline-original-selection": "you will need to temporary change the user password" }, "_links": { "webui": "/spaces/~xxxxx/pages/170165652/A+simple+introduction+to+REST?focusedCommentId=170167873" } } ], "_links": { "base": "https://xxxxx.atlassian.net/wiki" } }
Workaround
Append the property body-format=storage or body-format=atlas_doc_format (depending on what's desired) to the request URL and, as you can see in below example, the comment body is returned in the chosen/specified format:
- Request URL: https://xxxxxx.atlassian.net/wiki/api/v2/pages/xxxxxx/inline-comments?body-format=atlas_doc_format
- Response Body:
{ "results": [ { "id": "xxxxxx", "status": "current", "title": "Re: A simple introduction to REST", "pageId": "xxxxxx", "version": { "number": 1, "message": "", "minorEdit": false, "authorId": "xxxxxxxxxx", "createdAt": "2018-03-29T09:57:30.440Z" }, "body": { "atlas_doc_format": { "value": "{\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"text\":\"Outdated, you can now ask the customer to generate an API Token that they can revoke once the ticket is solved:\",\"type\":\"text\"}]},{\"type\":\"paragraph\",\"content\":[{\"text\":\"https://confluence.atlassian.com/cloud/api-tokens-938839638.html\",\"type\":\"text\",\"marks\":[{\"type\":\"link\",\"attrs\":{\"href\":\"https://confluence.atlassian.com/cloud/api-tokens-938839638.html\"}}]}]}],\"version\":1}", "representation": "atlas_doc_format" } }, [...] }