-
Bug
-
Resolution: Fixed
-
High
-
6
-
Severity 3 - Minor
-
11
-
Problem Definition
/rest/api/3/search does not return comment.body and worklog.body fields rendered in HTML even if we pass parameter expand=renderedFields.. This works well in Rest API v2
Steps to Reproduce
- Call the search endpoint version 2 in order to return some issues with comments and worklog like, e.g.: https://INSTANCE-URL/rest/api/2/search?jql=project%20%3D%20TRP%20ORDER%20BY%20key%20ASC&fields=comment,description,summary,worklog&expand=renderedFields
- See that the above endpoint returns the worklogs and comment details in HTML:
[...] "key": "TRP-1", "renderedFields": { "summary": null, "description": "<p>DESCRIPTION</p>\n\n", "comment": { "comments": [ { "self": "https://xxxxx.atlassian.net/rest/api/2/issue/10504/comment/10218", "id": "10218", "author": { "self": [...] }, "displayName": "[...] [...] }, "body": "<p>comment</p>", [...] "worklog": { "startAt":[...] [...] "worklogs": [ { "self": [...] }, "updateAuthor": { "name": "ID10850", "active": false }, "comment": "<p>Logged one day of work...</p>\n\n<p>Still 2 days to go!</p>", [...]
- Run the same search query using the V3 endpoint: https://INSTANCE-URL/rest/api/3/search?jql=project%20%3D%20TRP%20ORDER%20BY%20key%20ASC&fields=comment,description,summary,worklog&expand=renderedFields
Expected results
The same body as v2 is returned
Actual result
The worklog comments body is missing and the issue comments body is not rendered:
[...]
"key": "TRP-1",
"renderedFields": {
"summary": null,
"description": "<p>DESCRIPTION</p>\n\n",
"comment": {
"comments": [
{
"self": "https://xxxxxxx.atlassian.net/rest/api/3/issue/10504/comment/10218",
"id": "10218",
"author": {
[...]
},
"displayName": "[...]
[...]
},
"body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "comment"
}
]
}
]
},
[...]
"worklog": {
"startAt":[...]
[...]
"worklogs": [
{
"self": [...]
},
"updateAuthor": {
"name": "ID10850",
"active": false
},
"created": "Today 12:56 PM",
"updated": "Today 12:56 PM",
"started": "Today 4:56 AM",
"timeSpent": "1 day",
"id": "10003",
"issueId": "10504"
}
]
}
},
Workaround
Two possible workarounds:
- Use the v2 endpoint.
- Another way to get the comment body returned as HTML is to call the GET /rest/api/3/[ISSUE KEY or ID]/comments endpoint and append ?expand=renderedBody to it. This way you get something like:
"renderedBody": "<p>SOME COMMENT<br/>\nTEST BODY<br/>\nsadff<br/>\ndffffffffffffff</p>\n\n<p>istamana</p>\n\n<p>I write a comment</p>",
Unluckily this does not work for worklogs comments.
- is related to
-
JRACLOUD-83203 [Tracked in Issue Links] Jira Cloud bugs re expand=renderedFields
- Gathering Interest
- relates to
-
JRACLOUD-75825 renderedFields HTML returned in v3 REST API does not match the HTML in the new issue view
- Gathering Interest
- is resolved by
-
ISSUE-993 Loading...
(3 mentioned in)