Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Copy attachment

KouassiP
Tera Contributor

Hello All , 

In a RITM , i have a field where i attached a file (XLS) ...

KouassiP_0-1764706678827.png

 

Could you please show me how i can copy this file to another table ?

I have tried this , but the file is attached in the activity , not in the attachment doc . 

 

var attachmentGR = new GlideRecord('sys_attachment');

attachmentGR.addQuery('table_sys_id', ritmSysId);

attachmentGR.query();

if (attachmentGR.next()) {

    var sa = new GlideSysAttachment();

    sa.copy('sys_attachment', ritmSysId, sys_class_name , ciLDZ );

}

KouassiP_1-1764706957396.png

 

KouassiP_2-1764706972526.png

 

 

0 REPLIES 0