copy attachments from KB artcical to notifications email template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 01:47 AM - edited 12-01-2023 01:50 AM
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 :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 02:36 AM
email notification is on which table? please share screenshot.
try this once
var grAttach = new GlideRecord("sys_attachments");
grAttach.addQuery("table_name", "kb_knowledge");
grAttach.addQuery("table_sys_id", "56dba1121b36b998bcae5457604bcbdc"); // I updated here
grAttach.query();
if (grAttach.next()) {
GlideSysAttachment.copy('kb_knowledge', '56dba1121b36b998bcae5457604bcbdc', 'sys_email', current.sys_id);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 02:40 AM
notification are in sc_req_item table and when ever any request is created then one notification will trigger and i need to attach the attachments which is there in the Kb Artical . I have created email script to attaché tgem in the notification and its not working .is there any other way to add them in the notifications like Business rules ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 02:42 AM
RITM is created and will have some files attached. but how are you linking RITM and KB?
Also when should the file be copied to KB?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 02:46 AM
Once ritm is created I am tiring the notification and I have created one Kb artical and i have added one attachment in the Kb artical .Once the notification is triggered In that notification i have to add the attachments which is present in the Kb artical.