Backslash in comment rendered as <br ... /> in renderedFields

Leaving a comment with a backslash on a Jira issue: backslash in comment: \ let’s see what happens returns the following in renderedFields: <p>backslash in comment: <br class="atl-forced-newline" /> let’s see what happens</p>.

API call: GET /rest/api/2/search?jql=<JQL here>&fields=*all&expand=renderedFields,transitions

Is this expected behavior? I would expect the backslash to be visible, like it is on the web.

What happens when you try to escape the backslash with another backslash?

1 Like

Commenting on the web: from Jira double backslash: \\ asdf the API returns the rendered html: <p>from Jira double backslash: \\\\ asdf</p>.

Also, it appears that posting a comment via the API with a single backslash works as expected but with a double backslash causes the same issue on Jira web as well.

Viewed on Jira web: first two comments posted via the API, second two comments created on Jira web.


I’m not 100% sure if any of those are suitable workarounds, if not, probably best to raise a DEVHELP ticket.