- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 12:13 PM
My script is not working,
GlideSysAttachment.copy('incident', current.parent, 'problem', current.sys_id);
var attach = new GlideSysAttachment();
attach.update(current.request_item.getRefRecord());
or
table : sys_attachment
Condition: current.table_name == 'incident'
var task = new GlideRecord('problem');
task.addQuery('parent',current.sys_id);
task.query();
while(task.next()) {
GlideSysAttachment.copy('incident', current.parent, 'problem', current.sys_id);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 02:44 PM
Hi Chanikya,
here is the script
Business rule: Copy Incident attachment into Problem
after
table : sys_attachment
insert, update
Script:
var atta = new GlideRecord('problem');
atta.addQuery('parent', current.table_sys_id);
atta.query();
if(atta.next())
{
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id', atta.sys_id);
gr.deleteMultiple();
GlideSysAttachment.copy('incident', current.table_sys_id, 'problem', atta.sys_id);
current.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 12:19 PM
Hello Chanikya,
Can you please give more info on where you want to transfer the attachment. Is it from Incident to problem table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 12:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 12:50 PM
Hi Pradeep,
Can you please provide any updates on this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2017 01:27 PM
Script should be
GlideSysAttachment.copy('incident', current.sys_id, 'problem', current.problem_id.sys_id);