- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 04:25 AM
Hi,
As per ServiceNow OOB functionality, whenever we closed the incident while checking the knowledge check box then the knowledge article will create. but I have a requirement where knowledge article should create when the incident will be Resolved.
need suggestions on the same.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 04:59 AM - edited 02-21-2024 05:07 AM
Hi @suru2,
If all else is equal and you simply want to create the Knowledge Article when the Incident is RESOLVED rather than CLOSED, then navigate to the existing Business Rule which handles this functionaility: 'Incident Create Knowledge'
(One way to locate this: Type 'Business Rules' on the navigation menu under 'System Definition' and search for it by name.)
Under the 'Advanced' tab of the Business Rule (as shown below), the standard configuration is checking for the condition change to IncidentState.CLOSED. Update this to IncidentState.RESOLVED.
The screenshot below should help guide you.
@suru2 - To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 05:06 AM
Assuming you are using the OOB config: change the condition on the Incident Create Knowledge business rule. It now states 'closed': (current.incident_state.changesTo(IncidentState.CLOSED) && current.knowledge == true) && (!pm.isActive('com.snc.incident.knowledge'))
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 04:59 AM - edited 02-21-2024 05:07 AM
Hi @suru2,
If all else is equal and you simply want to create the Knowledge Article when the Incident is RESOLVED rather than CLOSED, then navigate to the existing Business Rule which handles this functionaility: 'Incident Create Knowledge'
(One way to locate this: Type 'Business Rules' on the navigation menu under 'System Definition' and search for it by name.)
Under the 'Advanced' tab of the Business Rule (as shown below), the standard configuration is checking for the condition change to IncidentState.CLOSED. Update this to IncidentState.RESOLVED.
The screenshot below should help guide you.
@suru2 - To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 05:03 AM
HI @suru2 ,
I trust you are doing great.
You can achive this by trigger of an event from BR which will trigger the Script action:
Business Rule :
// Trigger on incident resolution
var gr = new GlideRecord('incident');
if (gr.state == 'Resolved' && gr.previous.state != 'Resolved') {
// Execute the script action
gs.eventQueue('incident.resolved.create.knowledge.article', gr, gr.incident_state);
}
Script action :
// incident.resolved.create.knowledge.article script action
(function() {
// Create a new knowledge article record
var knowledgeArticle = new GlideRecord('kb_knowledge');
knowledgeArticle.short_description = current.short_description; // You may need to customize this
knowledgeArticle.text = current.description; // You may need to customize this
knowledgeArticle.insert();
})();
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 05:06 AM
Assuming you are using the OOB config: change the condition on the Incident Create Knowledge business rule. It now states 'closed': (current.incident_state.changesTo(IncidentState.CLOSED) && current.knowledge == true) && (!pm.isActive('com.snc.incident.knowledge'))
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark