Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 03:15 PM
what would I script on business rule if I want all of the unapproved RITM sent a reminder to the approver

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 03:32 PM
You need a scheduled job to trigger the reminder. A business rule only runs when an action is taken such as update. Below thread may be helpful.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 07:07 PM
Hi @aniellacerna ,
As Sanjiv mentioned you would require a scheduled job in order to send reminders to the approvers. Here is a sample script which can be used
(function executeScheduledJob() {
var ritmGr = new GlideRecord('sc_req_item');
ritmGr.addQuery('approval', 'requested');
ritmGr.query();
// Iterate through unapproved RITMs and raise the event
while (ritmGr.next()) {
gs.eventQueue("unapproved_ritm_reminder", ritmGr, ritmGr.approver); // Raises the event for each unapproved RITM
}
})();
Please create the above event in even registry n notification which should trigger when this event is fired.
Thanks,
Danish