- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2020 07:36 AM
- 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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2025 01:54 AM
Can you post a new question with all the details and tag me there as this is an old thread?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2025 07:38 AM
Sorry, I didn't quite understand the request.
I'll do that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 05:10 AM
Hey
I'm using your code and it works fine but the attachment can only be seen from Notes or Activity Log and not from "Manage Attachments". If I manually upload an attachment directly in the destination record form, it appears normally.
Do you know how to solve this issue?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 05:26 AM
Need to check
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader