- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 08:15 AM
Hi,
I am trying the copy attachment from sys_email to case record so i havee used below code but not getting mapped.
Can anyone please let us know where i missed?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2025 08:51 AM
Is the email coming of type Reply and it has attachment and you want to add that file to target record?
If yes then do this in inbound action of type Reply
GlideSysAttachment.copy('sys_email', sys_email.sys_id, 'sn_customerservice_case', current.sys_id);
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-28-2025 08:13 PM
Glad to know.
Please mark my below response as correct and close the thread.
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-28-2025 08:13 PM
Glad to know.
Please mark my below response as correct and close the thread.
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-29-2025 02:44 AM
But i have forward inbound action that will work when we forward with any existing Case number it will map the body to worknotes else if not matching the case number it will create new record and it will map the body to worknotes so here i want to create a another function for copy attachments from sys_email to case ticket.
If i used this below line of code. It is getting duplications:
GlideSysAttachment.copy('sys_email', sys_email.sys_id, 'sn_customerservice_case', current.sys_id);For ex: If i add "A" image from email it should get to case form CS0001 and again if i add the same "A" image from email with the same record CS0001 it should not update.
Can you please help on this.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2025 02:48 AM
then check if the file is already there then don't copy
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
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2025 07:06 AM
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
