- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2026 03:11 PM - last edited 2 weeks ago
Hello All,
We are trying to force the Now Assist Skill "Generate KB" to use the "How To" template instead of the standard default one.
We cloned the skill, then added 2 new Prompts one for single and the other for multiple per instructions by servicenow docs, see the links at the bottom of the post, after publishing the skill and test via now assist panel AI is still using the default template "kb_knowledge" we require to use the "kb_knowedge_how_to" we checked the fields and everthing match what is on the prompt.
This is the last portion of the prompt
Output Format:
Before completing, verify that each list item is in a new line, in all cases of a numbered list. *Always generate a valid JSON object.
Generate a JSON response in the following format:
{
"kb_introduction": {
"Problem": "string",
"Severity": "string
},
"kb_instructions": {
"Steps To Resolve": "string"
},
“short_description”: {
“Title”: “string”
}
}This is the Target template (see fields matches)
Configure skills with custom prompts for knowledge article templates
Guidelines for creating prompts
None of this worked 😞
Thanks! please read before posting!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This is what we did to force it to use the "HOW TO", I am not sure if this is best practice or it might impact your instance implement this by your own responsibility.
The idea is to add a new template mapping on the script include for your custom template or in my case HOW TO
The KB article template fields must match the definition/ mapping on the following script include
- Every SNC script include always have an extended class for overwriting the protected class.
- Go to KnowledgeGenAIFormData script include
- then set the initialize function to this:
var KnowledgeGenAIFormData = Class.create();
KnowledgeGenAIFormData.prototype = Object.extendsObject(KnowledgeGenAIFormDataSNC, {
initialize: function(skillId, targetLanguage) {
this.targetLanguage = targetLanguage;
this.skillId = skillId;
this.templateFieldHeaderMap = {
'kb_knowledge': {
'text': [
"Problem",
"Root Cause",
"Steps to Resolve"
],
'short_description': "Title"
},
'kb_template_kcs_article': {
'short_description': 'Title',
'kb_issue': 'Problem',
'kb_cause': 'Root Cause',
'kb_resolution': 'Steps to Resolve'
},
'kb_template_incident_kcs_article_html': {
'short_description': 'Title',
"kb_issue": [
'Problem',
'Root Cause'
],
'kb_resolution': 'Steps to Resolve'
},
//this is the new line for your custom template or in my case the HOW TO
//The fields of your template must match the names of the following JSON
'kb_template_how_to': {
'short_description': 'Title',
'kb_introduction': [
'Problem',
'Severity'
],
'kb_instructions': 'Steps to Resolve'
}
};
},
type: 'KnowledgeGenAIFormData'
});- Clone the OOTB "KB generation skill
- On your cloned skill create a new Prompt e.g "How to Single KB article"
- Add this Adjust it later for your requirements, this prompt will generate the format for a "HOW TO" kb article template with 2 Fields Introduction and Instructions
- See attached txt prompt
- Save the record
- The Prompt will ask the AI to generate the following format with the generated text (adjust it later after you make it work initially) I just added some comments to make it easier to understand this JSON format is just an example.
{
"kb_introduction": { <---- Target field name, must be mapped on KnowledgeGenAIFormData() step 1
"Introduction": "string", <--- This will print The Introduction title and generated AI text for the kb_introduction field per prompt instructions
"Severity": "string" <--- This will print the Severity Title and genereated AI text for the the kb_introduction field per prompt instructions
},
"kb_instructions": {
"Steps To Resolve": "string" <--- This will print the Instructions title and generated AI text if any on kb_instructions field per prompt instructions
},
"short_description": {
"Title": "string" <--- as the name suggest will set the Short description with the title set here
}
}- The idea of the new prompt is to generate something like this (example)
```json
{
"kb_introduction": {
"Introduction": "You are experiencing difficulty connecting to the VPN, resulting in an error message that prevents access to the firm network. The issue is preventing you from establishing a secure connection as required.",
"Severity": "High"
},
"kb_instructions": {
"Steps To Resolve": "1. Verify that your VPN client is up to date and restart the application to ensure no temporary glitches are causing the connection failure. 2. Check your internet connection stability by attempting to access a website or service outside the firm network to rule out broader connectivity issues. 3. Review the VPN error message details for specific codes or descriptions, and cross-reference them with known troubleshooting guides for your VPN provider. 4. If the issue persists, contact your organization's IT support team with the error message details and steps already attempted to facilitate further diagnosis and resolution."
},
"short_description": {
"Title": "Troubleshooting VPN Connection Issues"
}
}
```- Then the mapping will do the rest for you
- Go to script includes, and look for KnowledgeGenAIUtils
- Add the following 2 functions the initialize and the generateArticleFromResponse (make sure to adjust to your kb template name)
initialize: function() {
this.STANDARD = "kb_knowledge";
this.KCS_TEMPLATE = "kb_template_kcs_article";
this.KCS_INCIDENT_TEMPLATE = "kb_template_incident_kcs_article_html";
this.ADVANCED_INSTALLER = "com.snc.knowledge_advanced.installer";
this.KCS_INCIDENT_PLUGIN = "com.snc.incident.knowledge";
this.INCIDENT_TABLE = "incident";
this.CSM_TABLE = "sn_customerservice_case";
this.HR_TABLE = "sn_hr_core_case";
this.CSM_TEMPLATE_WORKSPACE_PROPERTY = "sn_customerservice.kcs.enable_template_on_case_workspace";
this.CSM_KCS_PROPERTY = "sn_customerservice.enable_knowledge_kcs";
this.SUCCESS = "success";
this.TITLE = "Title";
this.LLMProvider = "Now LLM";
this.SHORT_DESCRIPTION = "Short Description";
this.ARTICLE_BODY = "Article Body";
this.CONFIG_SCREEN_CHOOSE_INPUT = "0fd5c2b548fcf510f877f4bbb31a68de";
this.CONFIG_SCREEN_DEFINE_AVAILABILITY = "d51b3a7d25cb3110f8776ab691d522af";
this.CONFIG_SCREEN_SKILL_CONFIG_PROMPTS = "5a63045793dc1210aa5730f1648918a4";
this.LLM_GENERIC_MODEL_CONFIG_ID = '8327713a7ff0121056059c5cfc86656b';
this.skillConfig = {};
this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_NAME = "km_oob_prompt_supported_templates";
this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_VALUE = ["kb_knowledge", "kb_template_kcs_article", "kb_template_incident_kcs_article_html", "<INTERNAL_NAME_OF_KB_TEMPLATE>"];
},
generateArticleFromResponse: function(response, knowledgeBase, user, sourceId, tableName, targetTable) {
var article_template = <INTERNAL_NAME_OF_KB_TEMPLATE> //e.g kb_how_to_tempplate
if (Object.keys(this.skillConfig).length == 0)
this.skillConfig.knowledgeBase = knowledgeBase;
return this._createArticleFromResponse(response, knowledgeBase, user, sourceId, tableName, article_template);
},- Save
- Test.
SUMMARY:
Involved script incudes:
- KnowledgeGenAIUtils
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the custom kb article template, modify the generateArticleFromResponse function accordingly (use mine as an example)
- Copy the initilialize function from KnowledgeGenAIFormDataSNC or the provided one and add the JSON for mapping your KB article template fields and sections.
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the updated initialize function with the updated this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_VALUE check the provided one above.
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the custom kb article template, modify the generateArticleFromResponse function accordingly (use mine as an example)
Involved Skills
- KB Generation (Disabled after you clone)
- Copy of KB Generation
- Go to now assist skill kit and create a new Prompt using the provided one or the one that meets your requirements make sure to specify the formatted JSON output to match kb article template fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Same issue here, followed the article steps but the skill still targets the default table. Did you manage to get the skill to work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Yes sorry it was meant to be a question as well we had the same issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
This is what we did to force it to use the "HOW TO", I am not sure if this is best practice or it might impact your instance implement this by your own responsibility.
The idea is to add a new template mapping on the script include for your custom template or in my case HOW TO
The KB article template fields must match the definition/ mapping on the following script include
- Every SNC script include always have an extended class for overwriting the protected class.
- Go to KnowledgeGenAIFormData script include
- then set the initialize function to this:
var KnowledgeGenAIFormData = Class.create();
KnowledgeGenAIFormData.prototype = Object.extendsObject(KnowledgeGenAIFormDataSNC, {
initialize: function(skillId, targetLanguage) {
this.targetLanguage = targetLanguage;
this.skillId = skillId;
this.templateFieldHeaderMap = {
'kb_knowledge': {
'text': [
"Problem",
"Root Cause",
"Steps to Resolve"
],
'short_description': "Title"
},
'kb_template_kcs_article': {
'short_description': 'Title',
'kb_issue': 'Problem',
'kb_cause': 'Root Cause',
'kb_resolution': 'Steps to Resolve'
},
'kb_template_incident_kcs_article_html': {
'short_description': 'Title',
"kb_issue": [
'Problem',
'Root Cause'
],
'kb_resolution': 'Steps to Resolve'
},
//this is the new line for your custom template or in my case the HOW TO
//The fields of your template must match the names of the following JSON
'kb_template_how_to': {
'short_description': 'Title',
'kb_introduction': [
'Problem',
'Severity'
],
'kb_instructions': 'Steps to Resolve'
}
};
},
type: 'KnowledgeGenAIFormData'
});- Clone the OOTB "KB generation skill
- On your cloned skill create a new Prompt e.g "How to Single KB article"
- Add this Adjust it later for your requirements, this prompt will generate the format for a "HOW TO" kb article template with 2 Fields Introduction and Instructions
- See attached txt prompt
- Save the record
- The Prompt will ask the AI to generate the following format with the generated text (adjust it later after you make it work initially) I just added some comments to make it easier to understand this JSON format is just an example.
{
"kb_introduction": { <---- Target field name, must be mapped on KnowledgeGenAIFormData() step 1
"Introduction": "string", <--- This will print The Introduction title and generated AI text for the kb_introduction field per prompt instructions
"Severity": "string" <--- This will print the Severity Title and genereated AI text for the the kb_introduction field per prompt instructions
},
"kb_instructions": {
"Steps To Resolve": "string" <--- This will print the Instructions title and generated AI text if any on kb_instructions field per prompt instructions
},
"short_description": {
"Title": "string" <--- as the name suggest will set the Short description with the title set here
}
}- The idea of the new prompt is to generate something like this (example)
```json
{
"kb_introduction": {
"Introduction": "You are experiencing difficulty connecting to the VPN, resulting in an error message that prevents access to the firm network. The issue is preventing you from establishing a secure connection as required.",
"Severity": "High"
},
"kb_instructions": {
"Steps To Resolve": "1. Verify that your VPN client is up to date and restart the application to ensure no temporary glitches are causing the connection failure. 2. Check your internet connection stability by attempting to access a website or service outside the firm network to rule out broader connectivity issues. 3. Review the VPN error message details for specific codes or descriptions, and cross-reference them with known troubleshooting guides for your VPN provider. 4. If the issue persists, contact your organization's IT support team with the error message details and steps already attempted to facilitate further diagnosis and resolution."
},
"short_description": {
"Title": "Troubleshooting VPN Connection Issues"
}
}
```- Then the mapping will do the rest for you
- Go to script includes, and look for KnowledgeGenAIUtils
- Add the following 2 functions the initialize and the generateArticleFromResponse (make sure to adjust to your kb template name)
initialize: function() {
this.STANDARD = "kb_knowledge";
this.KCS_TEMPLATE = "kb_template_kcs_article";
this.KCS_INCIDENT_TEMPLATE = "kb_template_incident_kcs_article_html";
this.ADVANCED_INSTALLER = "com.snc.knowledge_advanced.installer";
this.KCS_INCIDENT_PLUGIN = "com.snc.incident.knowledge";
this.INCIDENT_TABLE = "incident";
this.CSM_TABLE = "sn_customerservice_case";
this.HR_TABLE = "sn_hr_core_case";
this.CSM_TEMPLATE_WORKSPACE_PROPERTY = "sn_customerservice.kcs.enable_template_on_case_workspace";
this.CSM_KCS_PROPERTY = "sn_customerservice.enable_knowledge_kcs";
this.SUCCESS = "success";
this.TITLE = "Title";
this.LLMProvider = "Now LLM";
this.SHORT_DESCRIPTION = "Short Description";
this.ARTICLE_BODY = "Article Body";
this.CONFIG_SCREEN_CHOOSE_INPUT = "0fd5c2b548fcf510f877f4bbb31a68de";
this.CONFIG_SCREEN_DEFINE_AVAILABILITY = "d51b3a7d25cb3110f8776ab691d522af";
this.CONFIG_SCREEN_SKILL_CONFIG_PROMPTS = "5a63045793dc1210aa5730f1648918a4";
this.LLM_GENERIC_MODEL_CONFIG_ID = '8327713a7ff0121056059c5cfc86656b';
this.skillConfig = {};
this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_NAME = "km_oob_prompt_supported_templates";
this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_VALUE = ["kb_knowledge", "kb_template_kcs_article", "kb_template_incident_kcs_article_html", "<INTERNAL_NAME_OF_KB_TEMPLATE>"];
},
generateArticleFromResponse: function(response, knowledgeBase, user, sourceId, tableName, targetTable) {
var article_template = <INTERNAL_NAME_OF_KB_TEMPLATE> //e.g kb_how_to_tempplate
if (Object.keys(this.skillConfig).length == 0)
this.skillConfig.knowledgeBase = knowledgeBase;
return this._createArticleFromResponse(response, knowledgeBase, user, sourceId, tableName, article_template);
},- Save
- Test.
SUMMARY:
Involved script incudes:
- KnowledgeGenAIUtils
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the custom kb article template, modify the generateArticleFromResponse function accordingly (use mine as an example)
- Copy the initilialize function from KnowledgeGenAIFormDataSNC or the provided one and add the JSON for mapping your KB article template fields and sections.
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the updated initialize function with the updated this.KM_OOB_PROMPT_SUPPORTED_TEMPLATES_KEY_VALUE check the provided one above.
- Overwrite the KnowledgeGenAIUtilsSNC to force the script to use the custom kb article template, modify the generateArticleFromResponse function accordingly (use mine as an example)
Involved Skills
- KB Generation (Disabled after you clone)
- Copy of KB Generation
- Go to now assist skill kit and create a new Prompt using the provided one or the one that meets your requirements make sure to specify the formatted JSON output to match kb article template fields.