- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 12:52 AM
Hi,
Our change request is configured in such a way that once any change request is closed, all the fields become read-only.
Now we have a requirement where, we need to update the close code from "successful" to "successful with issues" if any incident has been created related to change after the closure of the change request.
Kindly help me through this as i am new to scripting.
Thanks in Advance!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 01:11 AM
Hi
You can write a business rule on incident table as below
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('change_request');
gr.addQuery('sys_id',current.caused_by);
gr.query();
if(gr.next())
{
gr.close_code = "successful_issues"; //check value of successful with issues.
gr.update();
}
})(current, previous);
Mark as correct and helpful if it works.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-06-2022 01:54 AM
Hi Sumanth and ideamax,
i tried doing as you suggested, but still the close code is not updating