Standard article template for knowledge base

Bart van der Wu
Mega Expert

Hi there,

I have enabled multiple article templates that will be used for a specific knowledge base.
There are some knowledge bases that should only have the standard article template.

on https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/knowledge-management/task... it states you can link article templates to specific knowledge bases and 'If the Article Templates related list is empty, articles can be created using any article template.'

The problem is that the 'standard' article template cannot be selected in the related list. If you leave it empty it shows all article templates.

Is there a way to link only the standard article template to a knowledge base?

10 REPLIES 10

Sweta1012
Tera Contributor

Hi Bart, 

I also have got kind of same requirement. If a knowledge base has some templates selected they should be shown, but if any knowledge base doesn't have any article template selected for it, it should only have the standard template shown up while creating a new knowledge article. Now when any knowledge base which doesn't have any template selected is used for creating a knowledge article, instead of only the standard template, list of all templates show up. Can you suggest me how you solved this issue? I also wanna link only standard template to the knowledge bases which doesn't have any selected templates for it

Kim27
Tera Guru

Hello, I just tested out a workaround that seemed to be successful. For this to work you will need an inactive template. 

  • Create a template or use an existing template you have can inactivate. 
  • Add the template to the KB you wish only to show only the Standard template. Save the KB
  • Return to the template and uncheck the "active" box. 
    Kim27_2-1698682758407.png

  • Validate the template in your KB is now set to Active = False
    Kim27_1-1698682741080.png

When you create a new article, you should now only see the option for the standard template. 

Sweta1012
Tera Contributor

Thanks a lot.. Will definitely try this. Just curious like we have a OOB SI "ArticleTemplateUtil", can it be modified somehow to achieve this requirement. I am a bit new to servicenow, so not sure if it could be considered as one of the way to achieve this need or not

Let us know if it works! I'm not sure what can be done in the backend. I'm sure if you can get one of your Admins to review there's likely other ways to achieve this. Our Admins have quite the backlog they are working through so if I can find a workaround, I run with it! :-).

I think @Kim27 's solution is probably the easiest way especially since it doesn't involve any customizations.

If you wanted to update the OOB Script Include "ArticleTemplateUtil", you would need to copy the function "getArticleTemplatesForKnowledgeBase" from the Script Include "ArticleTemplateUtilSNC" and then modify the section of code that starts with "if(!gr.hasNext()){" so that it meets the requirements.

If I was doing this customization, I create a new field on the knowledge base table such as "only include standard template if no other templates are listed" and then update the script include to check that as well. Then the knowledge owner can decide if they want to show all templates even if not listed (OOB behavior) or only show standard template if nothing is listed in the related list.

 

Hope this helps!