- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 07:15 AM
Hello,
We have a catalog task notification that gets sent out when the catalog task is created. I would like to add any attachments the user attached during item submission. I have checked the include attachments but no luck. Any assistance is appreciated.
Thanks,
Chad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 07:22 AM
@Community Alums
that won't work as that checkbox will support only when file is present on catalog task
you need to copy file from RITM to SC Task when it gets created and ensure Include Attachment checkbox = True
you can use before insert BR on sc_task and copy that
Condition: current.request_item.cat_item.name == 'Your Catalog Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);
})(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
01-11-2024 07:22 AM
@Community Alums
that won't work as that checkbox will support only when file is present on catalog task
you need to copy file from RITM to SC Task when it gets created and ensure Include Attachment checkbox = True
you can use before insert BR on sc_task and copy that
Condition: current.request_item.cat_item.name == 'Your Catalog Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);
})(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
01-11-2024 08:51 AM
Hello, Appreciate the response. Works but getting duplicate attachments at ritm due to the business rule attached. Is there a way to put an exception in this rule for one catalog item?
Thanks,
Chad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 08:25 PM
@Community Alums
the approach I mentioned is Before Insert BR on SC Task and not sys_attachment
Please use the same
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