Create Knowledge Article from Incident when it will Resolved.

suru2
Tera Contributor

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,

2 ACCEPTED SOLUTIONS

Robbie
Kilo Patron
Kilo Patron

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

 

Screenshot 2024-02-21 at 12.55.04.png

View solution in original post

Mark Manders
Mega Patron

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

View solution in original post

3 REPLIES 3

Robbie
Kilo Patron
Kilo Patron

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

 

Screenshot 2024-02-21 at 12.55.04.png

Amit Gujarathi
Giga Sage
Giga Sage

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 Manders
Mega Patron

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