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

eican
Kilo Guru

Check the field you are using for the referenced record.


The Label is "Approval for" but the field is called "sysapproval"


It was not really that. I knew the field name... I thought that ServiceNow would automatically copy attachments for approval email notifications. Anyway, I put together a script which accomplished this..


Is there any chance i could look at the script you put together and where you put it. I am needing almost the exact same thing we are sending group approvals and needing to attach a file to that group using a workflow.


Hello Casey,



I have a business rule that runs on the sysapproval_approver ( Approval ) table.



Details:


When: Before


Update: Yes


Order: 100


Condition: Your Own condition ( when shall we copy attachments ? All the time, for a specific task type ? You decide here.... )


Script:



(function(){



if(typeof GlideSysAttachment !== "undefined") {


      GlideSysAttachment.copy('table_to_copy_from', 'record_id', current.getTableName(),current.getUniqueValue());


} else {


      Packages.com.glide.ui.SysAttachment.copy('table_to_copy_from', 'record_id', current.getTableName(), current.getUniqueValue());


}



table_to_copy_from -> likely to be current.sysapproval.sys_class_name.toString()


record_id-> likely to be current.sysapproval.sys_id.toString()



})()