Synchronize attachments between Case and Incident

Christophe
Tera Contributor

Our customers created case via the web portal. Our engineers work in the incident. All the updates that should be visible for the customer are synchronized between case and incident. When a customer adds an attachment to the case, it is not visible in the incident. How can I make this work? I checked the forum and the documentation, but was not really able to find a solution. Thank you in advance for your help!

1 ACCEPTED SOLUTION

My pleasure and please start working on scripting by joining the developer's learning on https://developer.servicenow.com.

Kindly,mark the answer as correct if this helps you out so,this questions could be considered as closed for other community members.

Regards,

Munender

View solution in original post

21 REPLIES 21

I now have the following, but I receive quite some errors.

 

(function executeRule(current, previous /*null when async*/) {

var incGr = new GlideRecord('incident');

incGr.addQuery('<u_case>', current.table_sys_id);

incGr.query();

if(incGr.next())

{

GlideSysAttachment.copy('<sn_customerservice_case>', current.table_sys_id, 'incident', incGr.sys_id);

})(current, previous);

Hi,

This ain't good,please share the screenshot of your form .

rEGARDS,

mUNENDER

There they are. Thank you so much for your help!

Hi,

You can use code like this:

 

var incGr = new GlideRecord('incident');

incGr.addQuery('u_case', current.sys_id);

incGr.query();

if(incGr.next())

{

new GlideSysAttachment.copy('incident', incGr.sys_id, 'case', current.sys_id);

})(current, previous);

 

Regards,

Munender

The attachment is added to the Case, but does not sync to the Incident. 😞