B2B Integration between ServiceNow instances

Bidisha Das
Tera Contributor

Hi,

I am currently facing an issue with the work note decoding part which is sent via REST api.

So, we have this integration established between 2 SNOW instances. We have a BR that's encoding the work note using encodeURIComponent() before sending it via REST to the other instance & encode is done to handle special characters in the work note. Similarly, we are decoding the work note at the other end so that work note doesn't appear in encoded format in the respective Incident but somehow it's not able to decode & update the work note.

Below is the BR that we are using. Please help us figure out what's going wrong & how to sort the issue?

Before Update BR on Incident table - below is the code

var rr=new GlideRecord('sys_journal_field');
rr.addQuery('element_id',current.sys_id);
rr.addQuery('element','work_notes');
rr.orderByDesc('sys_created_on');
rr.setLimit(1);
rr.query();
if(rr.next())
{
rr.value = decodeURIComponent(rr.value);
rr.update();
}

The code works fine when I run in background script but it's not working when the integration gets triggered & the work note is updated in encoded format only in the respective incident.

Quick help will be really appreciated.Thanks.

1 REPLY 1

Jyoti8
Kilo Guru

Hi Bidisha Das,

 

Refer below links, I hope these might help you..:)

https://community.servicenow.com/community?id=community_question&sys_id=772d07a9db9cdbc01dcaf3231f96...

 

https://community.servicenow.com/community?id=community_question&sys_id=abfa0baddb5cdbc01dcaf3231f96...

 

https://community.servicenow.com/community?id=community_question&sys_id=002f38c5db573380d58ea345ca96...

 

https://community.servicenow.com/community?id=community_question&sys_id=13ab07a1db9cdbc01dcaf3231f96...

 

 

If my reply helps you at all, I’d really appreciate it if you click the Helpful button and if my reply is the answer you were looking for, it would be awesome if you could click both the Helpful and Accepted Solution buttons..:)

Thanks