- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 09:08 AM
How to add quantity and attachment from catalog form in csm portal to related SCTask, after submission of the Request ?
I want to add the highlighted quantity and attachment from the catalog form in csm portal to respective RITM, specifically to related SCTask after submission of the Request.
@Ankur Bawiskar Platform Experts
Looking forward to your response.
Thanks,
Abhijit
Solved! Go to Solution.
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 09:59 AM
so you want to pick quantity and attachment and add to sc_task?
You can copy attachment when sc_task is inserted and it will copy file from RITM to SC Task
But why quantity is required?
After insert business rule on sc_task
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
new 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
06-09-2025 09:59 AM
so you want to pick quantity and attachment and add to sc_task?
You can copy attachment when sc_task is inserted and it will copy file from RITM to SC Task
But why quantity is required?
After insert business rule on sc_task
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
new 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
06-09-2025 10:59 AM
Thanks @Ankur Bawiskar , the above answer is correct. I have got the scenario 2 answer as well.
(function executeRule(current, previous /*null when async*/) { var taskRec = new GlideRecord('sc_task'); taskRec.addQuery("request_item.request", current.table_sys_id.toString()); taskRec.query(); while(taskRec.next()){ GlideSysAttachment.copy(current.table_name.toString(), current.table_sys_id.toString(), "sc_task", taskRec.sys_id.toString()); } })(current, previous);
Thanks for your immediate support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 10:25 AM
Quantity is required, since these are hardware items for the store, so there can be more than 1 quantity.
Also can you help in achieving the next scenario - Copy attachment in SC Task, when requester update from Portal.