We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Automatically include attachments from TASK, on Email Client Template

SammBroadbent
Tera Contributor

I found an old discussion but didnt seem to show the answer resolved the issue.

I am wanting to see if its possible to automatically include any attachments from a task, on Email Client Template when opened up from the ellipsis menu.. 

SamanthaBroad1_0-1721316261569.png


Looking at previous help, they mentioned creating a Notification Email Script with the following code...

var sysID = current.sys_id;
var grAttach=new GlideRecord('sys_attachment');
grAttach.addQuery('table_name','sn_vdr_risk_asmt_task');
grAttach.addQuery('table_sys_id',sysID);
grAttach.query();
while(grAttach.next())
{
template.print ( 'Attachment: <a href="/sys_attachment.do?sys_id=' +grAttach. sys_id + '">' + gr.file_name + '</a>\n ' );

}

but it doesnt work, is there something i've done wrong?
Thanks,
0 REPLIES 0