Business rule

aniellacerna
Tera Contributor

what would I script on business rule if I want all of the unapproved RITM sent a reminder to the approver

 

2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

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.

https://www.servicenow.com/community/itsm-forum/article-approval-reminder-email-using-scheduled-job-...

 


Please mark this response as correct or helpful if it assisted you with your question.

Danish Bhairag2
Tera Sage
Tera Sage

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