How to use template for kb articles

Mi4
Tera Expert

Hi,

There is a table with check boxes that determine whether knowledge can be created.
If this checkbox is updated with true, a knowledge article will be created.
Up to this point, it was realized, but I would like to create it using a template.
When I create a template, I get the following error:

 

business rule:

add 29 Lines

How can I solve this and call the template I created?

Thanks in advance.

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello MI,

applyTemplate is not available to scoped apps. Can you try with workaround mentioned here https://community.servicenow.com/community?id=community_question&sys_id=580e0baddb9cdbc01dcaf3231f96...

Reference script by Paul.

var sys_id_of_template = '56a8e507db6b26405accd5f0cf96190b';   


var grObj = new GlideRecord('incident');   


var t =   new GlideTemplate.get(sys_id_of_template);   


t.apply(grObj); 

- Pradeep Sharma

View solution in original post

5 REPLIES 5

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello MI,

applyTemplate is not available to scoped apps. Can you try with workaround mentioned here https://community.servicenow.com/community?id=community_question&sys_id=580e0baddb9cdbc01dcaf3231f96...

Reference script by Paul.

var sys_id_of_template = '56a8e507db6b26405accd5f0cf96190b';   


var grObj = new GlideRecord('incident');   


var t =   new GlideTemplate.get(sys_id_of_template);   


t.apply(grObj); 

- Pradeep Sharma

Hi,

Thank you.
This worked!

 

Regards,

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

You are very welcome Mi. Thanks for the update.

Ankush Jangle1
Kilo Guru

Hi 

To change the base "Create New" Knowledge Base Article Template:

 

  1. As an admin, access System Definition > Templates
  2. Filter the list on Table, searching for *kb
  3. You should see a list of the Knowledge Base Article templates (you'll probably only see one, we have several)

    Capture1.PNG
  4. Click on "New article" and edit it to suit your needs

 

 

The next time you click "Create New" under the Knowledge application, your new template will be used.

 

 

 

If you'd like to have different templates, then just create new ones in the same area, on the kb_knowledge table.   Then to access them you'll "Create New" on an article, then right-click the header to access the contextual menu, select Templates > Apply Template and select the template you want to use.   The current body of the article will then be deleted and replaced with the Template you selected.

 

 

 

Capture2.PNG

 

 

Please mark it Helpful/Correct if it Helps you