Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 07:36 AM
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 07:40 AM
Hi Praveen,
I assume you want attachment to be copied over from SC Task to RITM when attachment is added
sample BR on sys_attachment; It would be copying all attachments to RITM from SC TASK
BR: after insert on sys_attachment
Condition: current.table_name == 'sc_task'
Script:
var taskRec = new GlideRecord('sc_task');
taskRec.addQuery('sys_id', current.table_sys_id);
taskRec.query();
if(taskRec.next()){
var ritmRec = new GlideRecord('sc_req_item');
ritmRec.addQuery('sys_id',taskRec.request_item);
ritmRec.query();
if(ritmRec.next()){
GlideSysAttachment.copy('sc_task', current.table_sys_id, 'sc_req_item', ritmRec.sys_id);
}
}
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
20 REPLIES 20
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2021 05:26 AM
Need to check
Regards,
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
