- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 10:45 AM
Hi all!
I am writing a Before Business Rule to POST to Jira via Rest message when the task type field changes to an expected value. Everything is working fine, until I try to enter a multi-line value for the description field and continue to get errors when I kick it off.
Description field I'm attempting to post:
r.setStringParameterNoEscape('description', '"1. Do the first thing.\n2. Do the second thing.\n3. Do the third thing.\n4. Do the fourth thing.\n5. Do the fifth thing.\n6. Do the sixth thing.\n7. Do the seventh thing.\n\nUrl to first page: <URL TBA>\nTo open an Issue Task: <URL TBA>\n\nCreated from Build Task: ' + link + '"');
Error I am receiving:
response body: {"errorMessages":["Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value\n at [Source: org.apache.catalina.connector.CoyoteInputStream@4e603c07; line: 5, column: 55]"]}
This works perfectly:
r.setStringParameterNoEscape('description', '"Created from Build Task: ' + link + '"');
so I have to assume there's a typo in the multi-line code, but I must have looked at it for too long, because I can't see the trouble.
Thanks in advance for your assistance!
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 10:55 AM
Escape characters are there in the string that needs to be prefixed with \.
Try this.
r.setStringParameterNoEscape('description', '"1. Do the first thing.\\n2. Do the second thing.\\n3. Do the third thing.\\n4. Do the fourth thing.\n5. Do the fifth thing.\\n6. Do the sixth thing.\\n7. Do the seventh thing.\\n\\nUrl to first page: <URL TBA>\\nTo open an Issue Task: <URL TBA>\\n\\nCreated from Build Task: ' + link + '"');
or try
r.setStringParameter('description', '"1. Do the first thing.\n2. Do the second thing.\n3. Do the third thing.\n4. Do the fourth thing.\n5. Do the fifth thing.\n6. Do the sixth thing.\n7. Do the seventh thing.\n\nUrl to first page: <URL TBA>\nTo open an Issue Task: <URL TBA>\n\nCreated from Build Task: ' + link + '"');
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 10:55 AM
Escape characters are there in the string that needs to be prefixed with \.
Try this.
r.setStringParameterNoEscape('description', '"1. Do the first thing.\\n2. Do the second thing.\\n3. Do the third thing.\\n4. Do the fourth thing.\n5. Do the fifth thing.\\n6. Do the sixth thing.\\n7. Do the seventh thing.\\n\\nUrl to first page: <URL TBA>\\nTo open an Issue Task: <URL TBA>\\n\\nCreated from Build Task: ' + link + '"');
or try
r.setStringParameter('description', '"1. Do the first thing.\n2. Do the second thing.\n3. Do the third thing.\n4. Do the fourth thing.\n5. Do the fifth thing.\n6. Do the sixth thing.\n7. Do the seventh thing.\n\nUrl to first page: <URL TBA>\nTo open an Issue Task: <URL TBA>\n\nCreated from Build Task: ' + link + '"');
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 11:46 AM
Thanks so much, Muhammad!
I tried that earlier but must have had a different typo causing an issue.
This time changing to the \\n solved my issue.
Thanks again!