is there a way to include attachments on Approval Email Notifications without having to copy them from the "approval_for" reference record ?

Makosko
Tera Expert

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.

32 REPLIES 32

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.


Post your full email template. We can take a look at it for you.


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}


Try it at the bottom of the email template. Also Did you Change the MYInstance to your instance name?


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