Forwarding an email received in Servicenow with Attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:52 AM
I am using the below Business rule to forward any email received in Servicenow on a closed incident to itsupport@itisupport.com
(function executeRule(current, previous /*null when async*/ ) {
var sysid = current.instance; //geting sys id of incident from target field
var gr = new GlideRecord('incident');
gr.addEncodedQuery("sys_id", sysid);
gr.query();
if (gr.next()) {
var state = gr.state; //getting state value
}
if (state == '7') { //if state in closed
var mail = new GlideRecord("sys_email");
mail.initialize();
mail.mailbox.setDisplayValue("Outbox");
mail.recipients = ("tsupport@itisupport.com");
mail.subject = ("Fw: " + current.subject);
mail.body = (current.body);
mail.type = "send-ready";
mail.content_type = "multipart/mixed";
mail.insert();
}
})(current, previous);
my query is how can i add the attachments to this email i am forwarding as well?
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 03:00 AM
Hi Nishant,
Have you tried to achieve this using inbound email actions? Check the docs: https://docs.servicenow.com/en-US/bundle/sandiego-servicenow-platform/page/administer/notification/concept/inbound-action-processing.html
You can create a rule for forwarding this kind of email that matches your conditions and attachment would be forwarded as well.
If it was helpful, please give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 04:49 AM
Thanks for the response, but unfortunately i cannot find my answers in the link you shared
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2022 02:40 AM
The attachment that you want to forward are attach into the incident or into this new incoming mail?
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆