Cancel notifications if approver
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 11:56 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 02:14 PM
Wait... if the Opened By is ONE OF the Approvers, then NONE OF the Approvers get email?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2024 02:52 PM
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