Copy attachment to target ticket

if (!gs.nil(sysID)){
var sysAttachment = new GlideRecord('sys_attachment');
sysAttachment.addQuery('table_sys_id',current.sys_id);
sysAttachment.query();
var bCopy=false;
while(sysAttachment.next()){
gs.addInfoMessage("Copying attachment " + sysAttachment.file_name + " to target ticket " + gr.number +" [table:" +  ctype + "]");
bCopy=true;
}
if (bCopy){
GlideSysAttachment.copy('new_call',current.sys_id,ctype,gr.sys_id);//--copies them all in one go
}
}

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue