I want to copy the attachments from catalog form to incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 06:18 AM
Hello,
I am trying the scenario that whenever the attachment is attached on the catalog form and the user has selected incident in the dropdown option in one of the fields in catalog form, then I will check from attachment table which is the latest attachment attached to sc_cart_item and then copy it.
Script for reference:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 07:27 AM
so there is a variable which refers to incident table.
User is attaching file using OOTB paper-clip icon?
If yes then whenever user submits request, the attachments added while submission gets attached to RITM record
You can have after insert business rule on RITM table and have this logic
Business Rule: After Insert
Condition: current.cat_item.name == 'Your Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
new GlideSysAttachment().copy('sc_req_item', current.sys_id, 'incident', current.variables.variableName); // give here the variable name which refers to incident table
})(current, previous);
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-02-2025 08:01 PM
Hope you are doing good.
Did my reply answer your question?
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 01:17 AM
Hi Ankur,
No. its not being copied on any RITM. I am inserting a new record in incident directly after submission of the request.