Automatically create a known error article in problem

June Anderson
Tera Contributor

Hello guys 

 

I will like to configure problem to automatically create a known error article when the problem is moved to the closed state

How possible is it to achieve?

 

Thank you all 

3 REPLIES 3

Tushar
Kilo Sage
Kilo Sage

Hi @June Anderson 

 

I believe it is possible.

 

  1. You can start by defining a template for the Known Error article. This template should include the necessary fields and information that you want to populate automatically from the corresponding Problem record. 

      2. Now Determine the trigger point for the creation of the Known Error article.

          In this case, the trigger point is when the Problem record is moved to the closed state.

          You will use a Business Rule to detect this state change and take action accordingly.

     3. Create a Business Rule on the Problem table that runs when the state of the Problem record changes to                      closed.             

         The Business Rule should contain a script that will create the Known Error article based on the template you                defined in step 1.

This script will copy relevant information from the Problem record to the Known Error article.

 

// Business Rule script on Problem table
(function executeRule(current, previous /*, ... other inputs ... */) {
    if (current.state.changesTo('closed')) {
        // Create a new Known Error article
        var knownError = new GlideRecord('known_error');
        knownError.initialize(); // Initialize a new record with default values
        
        // Copy relevant information from the Problem record to the Known Error article
        knownError.short_description = current.short_description;
        knownError.description = current.description;
        // ... copy other relevant fields ...
        
        knownError.insert(); // Save the new Known Error article
    }
})(current, previous);

 

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar

I am looking at  your solution, however, I do have a question on your first line of code. Why do you have 

....other inputs ....*/

_William_Knight_0-1692207858041.png

 

Jeeban1
Kilo Contributor

Hi Anderson, Is your problem resolved ? I have also similar type of situation. Can you share me all the procedure and step you have taken if its successful for you ?