how to copy attachment from catalog task to RITM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2018 12:55 AM
i was trying to copy the attachement from task to Ritm it was working fine for 1 task and for 2 nd task the system getting hanged
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2018 09:41 AM
Try this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
GlideSysAttachment.copy('sc_task', current.sys_id, 'sc_req_item', current.request_item);
})(current, previous);
after and on update
if that doesnt work please follow this
https://community.servicenow.com/community?id=community_question&sys_id=8ba983e5db5cdbc01dcaf3231f96191b