- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 09:45 PM
I am trying to copy attachment from RITM to SCTASK record. I have written after-insert BR for that. its working when i submit the request by submitting the cat item. but to create RITM & SCTASK i have created one Inbound mail Action. its not working there. In the inbound mail action i have selected target table as "sc_req_item". So , the attachments coming from mail are getting attached directly to RITM record. but i want to copy the same attachments from the RITM to SCTASK record.
GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', current.sys_id);
This is the code i am using for copying attachment. Please if you can help. where should i debugg?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2022 09:40 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
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-06-2022 09:58 PM
Hi,
your inbound email action is on which table?
are you creating RITM from some custom logic?
Regards
Ankur
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-06-2022 10:02 PM
yes, its on sc_req_item table. & of type record action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 10:05 PM
Hi,
so it is of type Reply or New?
If new RITM is created then how is SC Task created? at that place only you can add code for attachment
you can query sc_task for the RITM and then copy
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.sys_id);
gr.query();
while(gr.next()) {
GlideSysAttachment.copy('sc_req_item', current.request_item, 'sc_task', gr.sys_id);
}
Regards
Ankur
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-06-2022 10:13 PM
I have created a workflow to create sc_request,sc_req_item & sc_task , and called it in Inbound action. its for new mail only