I have searched for this and am unable to find something as simple as how to insert a line feed within a response in ScriptRunner Console. Can anyone please advise me on how to accomplish this?
I am writing the script in the consolebut, instead of just returning the response data itself, what I'd like to do is prefix a text string to it, along with a couple of line feeds for readability.
What I am getting is:
"Success - Response Status Code & Data is: [expand:renderedFields,...]"
What I would like to see instead is:
Success
Response Status Code is: 200
Response Data is:
[expand:renderedFields,...]
Here is my query, with <insert line feed here> indicating where I wish to place the line feed syntax...
def issueKey = 'VSTA-1'
def issueFieldsGet = get("/rest/api/2/issue/${issueKey}")
.header('Content-Type', 'application/json')
.asObject(Map)
if (issueFieldsGet.status == 200) {
return "Success" + <insert line feed> + "Response Status Code is: " + issueFieldsGet.status + <insert line feed> + "Response Data is: " + <insert line feed> + issueFieldsGet.body
} else {
return "Error - Response Status Code Returned is: " + issueFieldsGet.status
}
Thank you to anyone who can advise.