- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 05:45 AM - edited 12-07-2023 05:45 AM
When the Change Request moves from Authorize to Scheduled state then Approval gets generated, if we reject the approval then the incident work notes must get updated that the 'Change has been rejected for the incident'. Please help me to figure out this
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 07:43 AM
There is definitely an extra } there, try this:
(function executeRule(current, previous /* previous state */) {
var incidentGR = new GlideRecord('incident');
if (incidentGR.get('rfc', current.sys_id)) {
// Update incident work notes
incidentGR.work_notes = 'Change request has been rejected: ' + current.number;
// Here you can also add a status change maybe
incidentGR.update();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:07 AM
Try to add Approval = Rejected on those conditions at the Business Rule and try it again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2023 08:11 AM
Yes it is working now. Thank you so much for the help😁