Inbound Email Action:Attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2009 03:53 PM
I have created an inbound email rule that will search any subject or email body for an incident number, and update the ticket accordingly. If it does not find an existing incident, it creates a new one. This functionality works whether a watermark is on the message or not.
When these emails have attachments, the new incidents that are created get the attachment just fine, but the incidents that are updates are not getting the attachments on the mail.
Anyone have any ideas what I am missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 01:42 PM
If you are using a query to retrieve the record that you update and are not using the current object, then that is your problem. Check the Wiki link below:
http://wiki.service-now.com/index.php?title=Inbound_Email_Actions#Attachments
I had a similar problem, but I was creating a new incident without using the current object to do it. I wrote the function below to associate the email with the new incident and copy any attachments to it as well.
function updateEmailAndCopyAttachments(emailId, destTable, destId) {
var em = new GlideRecord('sys_email');
em.addQuery('sys_id', emailId);
em.query();
if(em.next()) {
em.instance = current.sys_id;
em.update();
Packages.com.glide.ui.SysAttachment.copy ('sys_email', emailId, destTable, destId);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2009 01:46 PM
Thanks! I solved the issue last week, as you point out here, my issue was the wrong sys_id on the sys_email table. Now it works like a champ!
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2009 06:30 PM
I have created a triage holding place for inbound emails. One inbound action putting all email content into a triage table. If the email address is known in sys_user the incident is created from a business rule on the triage table.
The problem is that my triage record is not catching attachments. The wiki said that is should automatically but I find that is not true in my case. Ideas?
My inbound action looks like this....
current.u_to = email.to
current.u_direct = email.direct
current.u_from = email.from;
current.u_origemail = email.origemail;
current.u_subject = email.subject;
current.u_body_text = "Subject: ";
current.u_body_text += email.subject;
current.u_body_text += "\n";
current.u_body_text += email.body_text;
current.u_body = email.body;
current.u_copied = email.copied
current.u_recipients = email.recipients
current.u_recipients_array = email.recipients_array
current.u_triage_status = "Open"
current.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2009 09:39 AM
Hi All
How do I get the sys_id of the email being processed by my Inbound Action? I'm referencing to emailId variable in gmoore's function updateEmailAndCopyAttachments(emailId, destTable, destId)