- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 07:40 AM
I have a scenario where the attachments on the Incident table should be sent over to the third party via email notifications and I was able to achieve it via email_script.
The main challenge is that if they send an attachment via email to servicenow, how do we copy that attachment into servicenow and associate with its incident opened here. We have an inbound email action defined to read the body of emaiil and reading the data.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 07:47 AM
It should happen automatically by default.
If not, you can perform current.update() in inbound email actiion.
If it still not work, please feel free to use GlideSysAttachment() API using copy() method
Note: Please mark reply as correct / helpful if it answers your question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 08:00 AM
Should happen automatically.
Do you have an inbound action that you know is generating Incidents but NOT attaching attachments?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 08:03 AM
I am not using the OOB, I have a separate inbound action created. Where I am just using it to read the body of the email and create an incident with mapping all fields coming from XYZ to the incident fields in SNOW. I have nothing in particular to read the attachments in my script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 08:06 AM
Should still happen automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 08:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 07:47 AM
Use this:
var sysAttach = new GlideSysAttachment();
var emailSysId = sys_email.getUniqueValue();
gs.log("Email sys_id is: " + emailSysId, "TITUS");
if (emailSysId) {
var sysEmailAttachments = sysAttach.getAttachments("sys_email", emailSysId);
gs.log("Number of attachments found: " + sysEmailAttachments.getRowCount(), "TITUS");
gs.log("Updating attachments to table: " + current.getTableName() + " and sys_id: " + current.getUniqueValue(), "TITUS");
while (sysEmailAttachments.next()) {
sysEmailAttachments.setValue("table_name", current.getTableName());
sysEmailAttachments.setValue("table_sys_id", current.getUniqueValue());
sysEmailAttachments.update();
}
}