Automatically create a known error article
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 08:45 AM
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
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 12:59 PM
Hi @June Anderson ,
Try a before BR:
(function executeRule(current, previous /*, ... other inputs if needed */ ) {
if (current.state == 107 && current.state.changes()) {
// Create a new Known Error article record
var newKnownError = new GlideRecord('kb_template_known_error_article');
newKnownError.initialize(); // Initializes a new record
newKnownError.short_description = current.short_description; // Copy relevant data from problem record
newKnownError.kb_description = current.description;
newKnownError.kb_workaround = current.workaround;
newKnownError.kb_cause = current.cause_notes;
var articleSysID = newKnownError.insert();
gs.info("Known Error article created: " + articleSysID);
}
})(current, previous);