Automatically create a known error article in problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 08:46 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2023 09:27 AM - edited 08-02-2023 09:28 AM
I believe it is possible.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 10:45 AM
I am looking at your solution, however, I do have a question on your first line of code. Why do you have
....other inputs ....*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 07:20 AM
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 ?
