Need to add attachments to the case from email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2025 09:42 AM
Hi,
I have a requirement to update the state value and add the attachments to the case from email.
I have created Inbound email action and tested but the attachments are stored in sys_email table instead of Case table. i tried below code but its not working, please help me on this.
Inbound Email action: Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2025 10:20 AM
Hello @cp10 ,
You can simply copy the attachments from sys_email table to your Case table using GlideSysAttachment.copy() function instead of writing your code for // Get attachments from the email
************************************************************************
Hope the answer helps!
Happy Learning!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2025 02:24 AM
Hi Sanjana, Thanks for the reply. I have tried below code but its not working. could you please let me know what is the issue on this code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2025 04:36 AM
Hey @cp10 ,
You can refer below code (I have also referred it from UI action: Move Attachment To Target Record)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2025 05:08 AM
try this
I assume it's going inside that IF and finding that record
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