Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Copy attachments from Kb artical to Notification

sushma9
Tera Contributor

Hi All,

I am copying the attachments  from Kb article to notification email and i  writing the email script to do that but i its not working .Please find the attached script below and let me know if anything has to be modified.

 

script :

 var grAttach = new GlideRecord("sys_attachments");
    grAttach.addQuery("table_name", "kb_knowledge");
    grAttach.addQuery("sys_id", "56dba1121b36b998bcae5457604bcbdc")
    grAttach.query();
    if (grAttach.next()) {
        GlideSysAttachment.copy('kb_knowledge', '56dba1121b36b998bcae5457604bcbdc', 'sys_email', current.sys_id);
    }
5 REPLIES 5

Not applicable

use glide system attachment api 

Example:

IMG_20231201_161658.jpg