Missing email script 'Notification: Article created'

DylanBlumenberg
Tera Contributor

Hello!

One of our notifications is sending script errors. The notification is named "KM Subscription: Article created." When I checked the notification, it uses an email script named "Notification: Article created." However, this script does not exist in the email scripts table.

I opened a ticket with ServiceNow, and they suspected it was a custom script. I'd like to double-check with the community because I believe this script was an OOB script and not custom. There are other similarly named scripts created by "admin" in 2017, which is when we started using ServiceNow.

I don't see this script in any deletion restoration tables.

I created a Washington DC PDI and checked there, but I don't see the script either. I noticed that the functionality to subscribe to a Knowledge Base requires the plugin 'com.snc.knowledge_advanced,' which cannot be installed on the PDI.

I've repaired and loaded the demo data for 'com.snc.knowledge_advanced,' but the script is still not there. Does anyone else have this script, or was I wrong, and it is custom?

1 ACCEPTED SOLUTION

Jon23
Mega Sage

Hi @DylanBlumenberg,
Sorry, I don't see the notification on our instance either.

Jon23_0-1738025626966.png

 

View solution in original post

4 REPLIES 4

Jon23
Mega Sage

Hi @DylanBlumenberg,
Sorry, I don't see the notification on our instance either.

Jon23_0-1738025626966.png

 

Ankur Bawiskar
Tera Patron
Tera Patron

@DylanBlumenberg 

that notification itself is not present OOB.

That seems to be a custom notification and that email script is also not present OOB

 

AnkurBawiskar_0-1738034582554.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Drew72
Tera Contributor

Hello.  We are having the exact same issue.  This is not a custom article nor script, but OOTB.  The notification is inactive OOTB and the script is missing.  Did you ever find a solution?

 

 

Hey Drew, I ended up copying one of the similar notification email scripts and editing it to use on the 'Notification: Article created' email script. The script is below if you wanted to use it. 

 

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {
	var obj = new JSON().decode(event.parm2);
	var article_link = new KBCommon().getArticleLink(obj.sys_id);
	email.setSubject("Article '"+obj.short_desc+"' has been published to "+obj.knowledge_base+".");
	
    template.print("Hi  "+obj.receiver+",<br/>");
	template.print("<br/>");
	template.print("An article has been created on a knowledge base that you subscribe to.<br/>");
	template.print("<br/>");
	template.print("<b>Article Number</b>: <a href='"+article_link+ "'>"+obj.number+"</a><br/>");
	template.print("<b>Article Title</b>: "+obj.short_desc+"<br/>"); 
	template.print("<b>Knowledge Base</b>: "+obj.knowledge_base+"<br/>"); 
	template.print("<b> Created By</b>: "+obj.author+"<br/>");
	template.print("<br/>");
	template.print("This notification is for informational purposes only. No action is required from you at this time.<br/>");

})(current, template, email, email_action, event);