- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 05:47 AM
I have an attachment and i have added via catalog item view and it s available in the RITM after creating a request, but it s not present in the Sctask. How can i bring in Sctask ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 06:29 AM
you can use after insert business rule on sc_task to copy attachment from RITM to SC Task
(function executeRule(current, previous /*null when async*/ ) {
new GlideSysAttachment().copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);
})(current, previous);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 06:31 AM
Hi @divyadhanda ,
I tried your problem in my PDI and it is working fine for me please create one OnBefore Business Rule which works when sc_task inserted and add below script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var ritmId = current.request_item;
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', ritmId);
att.addQuery('table_name', 'sc_req_item');
att.query();
while (att.next()) {
GlideSysAttachment.copy('sc_req_item', ritmId, 'sc_task', current.sys_id);
}
})(current, previous);
Result:
RITM have attachment
Same attachment got attached to sc_task
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2025 03:29 AM
Could you please help with your code how many files will be copied?
Example: if RITM has 10 files then with your code using GlideRecord how many files will be there on catalog task?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 07:00 AM
Before Insert rule, right? I tried this solution with Before BR, and it works. Thanks a lot for the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2025 07:54 AM
Attachments added via a catalog item are linked to the RITM by default and do not automatically propagate to the SCTask. To make them available on the SCTask, you can modify the catalog item’s workflow or business rule to copy attachments from the RITM to the SCTask when tasks are created, typically using a script in a ‘on task insert’ business rule or in the workflow’s task creation activity. This ensures attachments are accessible on both the RITM and its associated tasks.