Inbound action attachment not copied to record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 09:33 PM
Inbound action email is received but attachment is not uploaded to the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 09:37 PM
Hello @Zuri
On which table the inbound email action target record present?
If it is custom target record, it may not work
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0953178
Please mark the answer as helpful and correct if helped.
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2024 03:32 AM
Check the script in the Script tab to ensure it is designed to handle and attach files to the target record.
var emailAttachment = email.attachments;
if (emailAttachment && emailAttachment.hasNext()) {
while (emailAttachment.hasNext()) {
var attachment = emailAttachment.next();
gs.log("Attachment found: " + attachment.name);
attachment.copyToRecord(targetTable, targetSysId);
}
}
Also, you may try to add logs to inbound email action to monitor its behavior.
gs.log("Inbound email triggered. Checking for attachments...");
if (email.attachments && email.attachments.hasNext()) {
gs.log("Attachments found: Processing...");
} else {
gs.log("No attachments found in the email.");
}
I would appreciate it if you could mark it as helpful or correct. This helps others in the community who may have similar questions.