copy attachments from KB artcical to notifications email template

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);
    }
9 REPLIES 9

@sushma9 

try the script I shared with 1 change

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

Not working

@sushma9 

so whenever RITM is created you are creating kb, at that time itself copy all files from RITM to KB

share that script

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

 

No  Ankur .we will create KB at only once and in the kb we will attach some files . When ever any ritm is created then one notification will trigger  and in that notification this file should be attached as a attachment.

@sushma9 

Sorry but your requirement is confusing.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader