Include attachment to Email notification on certain condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:01 PM - edited 02-08-2024 05:42 PM
Hey,
Anyone know the alternative way of Include Attachment checkbox in Email notification. I am trying to create an email notification on incident record and want to send that notification with attachment on incident record on certain state of Incident.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:30 PM
Hi @Bchaudhary you can have the condition of state when to trigger Notification with attachment and without attachment. In this case you will have 2 notifications
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:33 PM
@Harish KM Thanks for the response. I would only like to use one notification for all state. Any idea on that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:42 PM
Hi @Bchaudhary in that case you need to create a email script with your condition inside email script to call this email script inside Notification
example:
you need to create email script with below script:
if(current.state == 3)
{
var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id',current.sys_id);
gr.query();
if (gr.hasNext()) {
template.print("Attachments: <br />");
while (gr.next()) {
var attachLink = '<a href="' + gs.generateURL(gr.getTableName(),gr.sys_id) + '">' + gr.file_name + '</a>';
template.print(attachLink + "<br />");
}
template.print("<hr/>");
}
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 05:45 PM
Hey @Harish KM, I tried it. But it seems working for users who have access to instance. What if external user wants to access it? Thanks