Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Use Case:

When a catalog item requires a two-level approval process — Primary Level (Single Approver) and Secondary Level (Group/Department Approvers) — the system should exclude the Primary Approver from the Secondary Approval Group, if the same user is a member of both levels.



Example:

A catalog item first requires Manager ABC’s approval as the Primary Approver.

Next, it moves to the Department/Group Approval stage.

If Manager ABC is also part of the Group/Department Approvers, they should be excluded from the second-level approval to prevent duplicate approvals.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

// Get the Group Sys Id from the Input of Subflow
var group_sys_id = fd_data.subflow_inputs.group_sys_id;


var users = [];
var grGroupMember = new GlideRecord('sys_user_grmember');
grGroupMember.addQuery('group.sys_id', group_sys_id);
grGroupMember.query();
while (grGroupMember.next()) {
// Get the Primary level manager from the Subflow Input
if (grGroupMember.user.sys_id != fd_data.subflow_inputs.requested_for.manager){
users.push(grGroupMember.user.sys_id.toString());
}
}

return 'ApprovesRejectsAny[' + users + ']';

Loading