is there a way to include attachments on Approval Email Notifications without having to copy them from the "approval_for" reference record ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2014 08:55 AM
For some strange reason, I seem unable to have SN copy attachments from the approval_for reference record to an actual approval request. In my email notification, I have the "Include Attachments" field checked, still no attachments coming through. Is there something else I am forgetting to check ??
Any help with this would be very much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 06:47 AM
I already had the Business Rule in place, but I just tried adding the mail script to my email template and have not been successful after several different tweaks. It looks like it is only adding a blank line in the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 07:16 AM
Post your full email template. We can take a look at it for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 07:45 AM
Thanks. Here is my email template:
<mail_script>
var gr = new GlideRecord("incident");
gr.addQuery("task", current.sysapproval);
gr.query();
var type = current.sysapproval.u_type.getDisplayValue();
template.print("<b>Ticket Opened For: </b>${sysapproval.opened_for} \n");
template.print("<b>Ticket Assigned to: </b>${sysapproval.assigned_to} \n");
template.print("<b>Approval Reason:</b> \n ${sysapproval.u_approval_reason} \n");
</mail_script>
${mailto:mailto.approval}
<hr/>
${mailto:mailto.rejection}
<hr/>
<mail_script>
printattachments();
function printattachments() {
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id',current.sys_id);
gr.query();
while (gr.next()) {
template.print('View Attachment: <a href="https://MyInstance.service-now.com/sys_attachment.do?sys_id=' + gr.sys_id + '">' + gr.file_name + '</a>\n');
}
}
</mail_script>
${sysapproval}: ${sysapproval.URI}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 09:12 AM
Try it at the bottom of the email template. Also Did you Change the MYInstance to your instance name?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2015 09:14 AM
I have tried the script at the top, bottom, and middle of the template, but nothing has worked.
Yes, I changed the name of the instance, too.
Thanks