Cancel notifications if approver

F_bio Santos
Kilo Sage

Hi everyone, Im trying to modify the "Business Rule": "Approval Events (Non-Task)" and "Approval Events (Task)" on the "sysapproval_approver" table. When a record is inserted on the "sc_req_item" it triggers 3 notifications with will create 3 records on the "sysapproval_approver", what Im trying to do is:

If the "opened_by" in the record of the "sc_req_item" is one of the "approvers" in one of the records created in the "sysapproval_approver" the notification shouldnt be sent to any of the "approvers", Im not being abble to do this, rightnow the only thing I have achieved is for the notification not be sent to one of the approvers and not all of them ... 

Can anyone help with this?

Code:

            var grRITM = new GlideRecord('sc_req_item');
            grRITM.addQuery('opened_by', current.approver);
			grRITM.addQuery('sys_id', current.document_id);
            grRITM.query();

            if (!grRITM.hasNext()) {

                event += ".approval.inserted";
                gs.eventQueue(event, current, gs.getUserID(), gs.getUserName());
                approvalComment = getComment(isFD, getApproverUserName(current.approver), "requested to approve task");
                updateRecord(current, approvalComment);
            }
2 REPLIES 2

Uncle Rob
Kilo Patron

Wait... if the Opened By is ONE OF the Approvers, then NONE OF the Approvers get email?

Yes, because we have another rule that if the "opened_by" is one of the "approvers" the "approval request" gets "approved", but in this case we dont want the "notifications" to trigger