The CreatorCon Call for Content is officially open! Get started here.

Copy attachments from one catalog task to another

Mishu
Tera Expert

I have 4 catalog tasks, I want to copy all attachments from Task 1--> Task 2---> Task 3 --> Task 4 ---> Task 5.

Wrote a Before insert BR on sc_task table with condition as Cat item is "ABC" and State is 'Open'

 

var task = new GlideRecord('sc_task');
task.addQuery('request_item',current.request_item);
task.query();
if(task.next()){
gs.addInfoMessage('Triggered');
GlideSysAttachment.copy('sc_task', task.sys_id, 'sc_task',current.sys_id);
}

It goes inside if condition but not copying attachment
How can i achieve this ?

6 REPLIES 6

Samaksh Wani
Giga Sage

Hello @Mishu 

 

https://www.servicenow.com/community/now-platform-forum/copying-attachments-from-one-sc-task-to-anot...

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.

 

Regards,

Samaksh

Mishu
Tera Expert

@Ankur Bawiskar .. need your help here

Jim Coyne
Kilo Patron

Do you really want to be copying attachments?  This might be a better solution: TNT: "Related Attachments" Related List

Yes the requirement is like that only .