Using incident template when creating incident from knowledge article
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 11:14 PM - edited 01-14-2025 11:15 PM
When creating an incident from a knowledge article, how to pass a template for the incident, depending on the knowledge article?
So each knowledge article (in theory) could have their own specific incident template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 11:28 PM - edited 01-14-2025 11:32 PM
Hi @Bennie dijkslag Knowledge Articles in ServiceNow can be configured to have their own specific Incident Template. This means that when a user creates an incident from a Knowledge Article, the incident will automatically use the template associated with that Knowledge Article.
Implementation:
1. Add a Reference Field for Incident Template to Knowledge Article:
- Go to Knowledge > Knowledge Articles.
- Open the Knowledge Article form.
- Add a reference field called Incident Template that references the Incident Template [incident_template] table.
2. Create a UI Action for Creating an Incident:
- Go to System Definition > UI Actions.
- Create a new UI Action on the Knowledge Article form (e.g., "Create Incident").
- Ensure the Action name is set to something like create_incident.
- Set the Condition for when the button should appear, for example:javascriptCopy codecurrent.template != '' // Only show the button if a template is selected.
3. Script for the UI Action:
In the script of the UI Action, you will create a new Incident and set its Template field based on the Knowledge Article’s reference to the Incident Template.
Here’s an example script for the UI Action:
4. Create or Configure Incident Templates:
- Make sure that you have Incident Templates set up in the Incident Template [incident_template] table.
- Each template can define default values for Incident fields, such as Category, Priority, Impact, etc.
5. Test the UI Action:
- Once everything is configured, navigate to a Knowledge Article that has an associated Incident Template.
- Click the Create Incident button.
- The new Incident should be created with the template applied.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 11:33 PM - edited 01-14-2025 11:38 PM
Thanks, i will go ahead and try this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 12:19 AM
I'd like to send the KB-number as template name in the url for "create incident" on knowledge article. Adding a UI action only works when the article is opened from the module, not from the search results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2025 03:20 AM
Been searching more in the community and found this; adding "&sysparm_template=$[HTML:knowledgeRecord.number]" to the create incident link will do what i'm looking for.
Apart from the fact that, when the template does not exist, no other fields will be populated, even if you add them in the link.
The link is set in the system property: glide.knowman.create_incident_link