- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 05:15 PM
I have a workflow event triggering a notification in which I'm trying to attach some files to. Can anyone help with either a workflow script or business rule to copy attachments from the catalog item to the RITM so that they can be included in the notification.
I've tried attaching the files to the notification (and checked include attachments). Then used the below workflow script to copy them from notification to the RITM. However, the RITM attachments come through empty:
var copyAttachFile = new GlideRecord('sys_attachment');
copyAttachFile.addQuery('table_name','sysevent_email_action');
copyAttachFile.addQuery('table_sys_id','notification sys_id');
copyAttachFile.query();
while (copyAttachFile.next()) {
copyAttachFile.table_name = 'sc_req_item';
copyAttachFile.table_sys_id = current.sys_id;
copyAttachFile.insert();
}
I also have the attachments on the catalog item. It'd be great if it were possible to copy catalog item attachments to the RITM for use in the event triggered notification.
Thank you!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 08:35 PM
you can add below script to run script to copy attachment from catalog item to RITM
GlideSysAttachment.copy('sc_cat_item', current.cat_item, 'sc_req_item', current.sys_id);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 08:13 PM
Use GlideSysAttachment.copy('TABLE 1', current.sys_id, 'Table 2', Table 2 sys_id);
Refer https://community.servicenow.com/community?id=community_question&sys_id=eb8fdfb6db3b2b44190dfb24399619a2
Please Mark as ✅ Correct if this solves your issue and also mark ???? Helpful if it helps resolve your problem.
Thanks,
Saji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2020 08:35 PM
you can add below script to run script to copy attachment from catalog item to RITM
GlideSysAttachment.copy('sc_cat_item', current.cat_item, 'sc_req_item', current.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 01:31 AM
hi
I tried with above code but, it only copies in the activities section, we also need it in the header.
any idea how to achieve it other that business rule.
Regards,
Kalpana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2022 07:47 AM
Thank you, Mike! This was by far easier than any other solution I came across (trying to query the sys_attachment and sys_attachment_doc tables).