- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 06:22 AM
Afternoon all
I have an integration with another ServiceNow instance and creating and updating does not work if I have special characters in the short description and description. The line I am adding is (!@#$%^&*()\|[]{}<>|"&'%)
µë-Ö׬¶X§{. There is nothing on the business rule or Rest message that should stop this from going to the other side. What have I done wrong, or probably what have I not added in?
Thanks
Jack
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 08:19 AM
Are you currently using setStringParamer? Have you tried using setStringParameterNoEscape for fields that can contain special characters?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 08:19 AM
Are you currently using setStringParamer? Have you tried using setStringParameterNoEscape for fields that can contain special characters?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 09:12 AM
Could you confirm where I would set that? I have the below set in my business rule but it i still not working;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 09:32 AM
Oh, you're using setRequestBody here. I'll assume your test variable is an object that contains the short_description and description?
I just noticed you had " and ' in your value and it might break something whne using setRequestBody.
So when setting the description or short description, you'd want to escape that.
For example:
var test = {};
test.description = incident.description.replaceAll('"', '\"');
It's a bit hard to see, but I'm using ' and " here. I surrounded " with ' and then told the script to replace " with \".
Can you give that a try? So just add .replaceAll('"', '\"'); to where ever you're setting the description/short description at.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2024 08:23 AM
Hi @Jack62 ,
Did u check any regEx applied on target instance for short description/description field.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
