Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

incident integration

Jack62
Giga Guru

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

1 ACCEPTED SOLUTION

Weird
Mega Sage

Are you currently using setStringParamer? Have you tried using setStringParameterNoEscape for fields that can contain special characters?

View solution in original post

7 REPLIES 7

It is certainly ok in the target instance as they have other clients sending in tickets with the above characters

 

JAck

Hey Ashish, I got this working in the end. Thanks for your help. In the meantime I am having some issues sending attachments. I am getting the following in the logs. Any thoughts?

 

ONEiOLibrary.sendAttachment ::: Response to ONEiO call:
<!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1></body></html>

Jack62
Giga Guru

I am now having some issues with sending attachments with the below showing in the logs;

 

ONEiOLibrary.sendAttachment ::: Response to ONEiO call:
<!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1></body></html>

 

My code in my business rules is;

 

var parser = new JSONParser();
var parsed = parser.parse(responseBody);
var targetRec = parsed.result;
var attachmentCount = sendAttachments(current.getTableName(),
current.sys_id, targetRec.sys_id);
if (attachmentCount != "none") {
attachmentMsg = " Attachments successfully sent: " +
attachmentCount[0].toString() + ". Attachments failed to be sent: " +
attachmentCount[1].toString();
} else {
attachmentMsg = " Record had no attachments to send.";
}