MRVS Attachment to Copy on Actual Ticket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 09:03 PM
Hi! How to copy the attachment from MRVS to the actual request ticket?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:34 PM
I actually was able to copy using:
But it copies all the attachments from the same source. Is there a way to copy a single attachment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:44 PM
did you get a chance to check my above response where I shared solution?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 11:57 PM
Hi @Dark Kei ,
Please use the below code to copy single attachment from MRVS table to target table.
var gr = new GlideRecord('your_mrvs_table'); // your MRVS table
if (gr.get('sys_id', 'MRVS_RECORD_SYS_ID')) {
var attachments = new GlideRecord('sys_attachment');
attachments.addQuery('table_sys_id', gr.sys_id);
attachments.addQuery('table_name', 'your_mrvs_table');
attachments.orderBy('sys_created_on');
attachments.setLimit(1);
attachments.query();
if (attachments.next()) {
GlideSysAttachment.copy('your_mrvs_table', gr.sys_id, 'sc_request', 'REQ_SYS_ID');
}
}
Please accept my solution and give helpful if the above codes work for you.