how to copy attachment from one task to another?

Ujjwala1
Tera Contributor

Hello Experts,

 

We have received a requirement from client , we want the attachment added by task handler on sc_task table should get copied on another task so that concerned team can download the attachment added and do the needful

 

How can we achieve this?

 

 

All suggestions are welcome here,

 

 

Thank you,

Ujjwala

1 ACCEPTED SOLUTION

manjusha_
Kilo Sage

@Ujjwala1 

 

 

Refer this sample code:Create before insert business rule

var task = new GlideRecord('sc_task');

task.addQuery('request_item',current.request_item);//check proper names for Ritm reference field on sc_task record

task.query();

if(task.next()){

  1. GlideSysAttachment.copy('sc_task', current.sys_id, 'sc_task',task.sys_id);

}

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact

Thanks and regards,

Manjusha .

 

View solution in original post

6 REPLIES 6

Hey Thanks 😀 It worked for me!!

 

OlaN
Giga Sage
Giga Sage

Hi,

Instead of copying attachments between records in this way, I would instead suggest that you create a new related list, which show all attachments from other catalog tasks that are related to the same requested item.