Incident Resolution notes should be copied to problem worknotes once the incident is resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 08:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 09:12 PM
Your business rule script is looking good and ideally it should have updated to problem record.
I can see that there be issue with the "first_reported_by_task" field. Can you check if this field is already populated by the Incident you are trying to close. You can also add log after "probGr.query();" something like "gs.info(prbGr.getEncodedQuery()+' rows matched '+probGr.getRowCount());" to know if the query is fetching the right values.
Please mark the answer helpful and correct if it resolves the issue. Happy scripting 🙂
-Shantanu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 09:16 PM
// Add your code here
Hope so the solution had helped you, if you face any further error please update.
If you find it helpful kindly hit the like button and close this question, Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 09:26 PM
Hi @shantanu_patel8,
You might consider adding an additional condition in your Business Rule to ensure that the Problem ID is not empty, which will help avoid unnecessary processing.
Also, the issue might be related to the use of the first_reported_by_task field. Instead, you can try the script below that directly uses the problem_id reference field:
(function executeRule(current, previous) {
// Ensure the Problem record is linked and available
var probGr = new GlideRecord('problem');
if (probGr.get(current.problem_id)) {
probGr.work_notes = current.close_notes;
probGr.update();
}
})(current, previous);
Regards,
Ranjit