How to insert a new line when using lines the Jira REST API
The content on this page relates to platforms which are not supported. Consequently, Atlassian Support cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.
Purpose
When sending data to the Jira REST API, the new line character must be escaped. This KB instructs in how to do this.
Solution
Insert
'\n'
into the appropriate field. For the example below the description field will have a two line description, splitting after the word 'issue' and before 'using':"fields": { "project": { "key": "TEST" }, "summary": "REST ye merry gentlemen.", "description": "Creating of an issue\nusing project keys and issue type names using the REST API", "issuetype": { "name": "Bug" } }
This can be tested with the cURL command as normal:
curl -D- -u <user>:<pass> -X POST --data @<Example File> -H "Content-Type: application/json" https://<instance>/rest/api/2/issue/