Add a specific file in a notification

Diana Yazmin
Tera Contributor

Hi experts,

 

A notification has been created with the configuration to include attachments, the problem is that only 1 specific file that our fulfiller will place in the task is required to travel in the notification, not all of them. This is possible?

 

Thank you

2 REPLIES 2

vermaamit16
Kilo Patron

Harish KM
Kilo Patron

HI @Diana Yazmin you can create a notification email script like below, and pass the file name . Call this email script inside your notification to attach the attachment.

script:

attachLinks();
function attachLinks() {

var gr = new GlideRecord('sys_attachment');
gr.addQuery('table_sys_id',current.sys_id);
gr.addQuery('file_name',"");// pass the file name here
gr.query();
if(gr.hasNext()){
template.print('Attachments: \n');
while (gr.next()) {
var attachLink = '<a href="' + gs.getProperty("glide.servlet.uri") + gs.generateURL(gr.getTableName(),gr.sys_id) + '">' + gr.file_name + '</a>';
template.print(attachLink + '\n');
}
template.print('<hr/>');
}
}
Regards
Harish