Skip to content

Commit bdb33bf

Browse files
committed
Second Level Approval Validation
1 parent 9a8fe4f commit bdb33bf

File tree

2 files changed

+32
-0
lines changed
  • Specialized Areas/SubFlow/Assign Group Level Approver After Removing Already Approved

2 files changed

+32
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Use Case:
2+
3+
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.
4+
5+
6+
7+
Example:
8+
9+
A catalog item first requires Manager ABC’s approval as the Primary Approver.
10+
11+
Next, it moves to the Department/Group Approval stage.
12+
13+
If Manager ABC is also part of the Group/Department Approvers, they should be excluded from the second-level approval to prevent duplicate approvals.
14+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
// Get the Group Sys Id from the Input of Subflow
3+
var group_sys_id = fd_data.subflow_inputs.group_sys_id;
4+
5+
6+
var users = [];
7+
var grGroupMember = new GlideRecord('sys_user_grmember');
8+
grGroupMember.addQuery('group.sys_id', group_sys_id);
9+
grGroupMember.query();
10+
while (grGroupMember.next()) {
11+
// Get the Primary level manager from the Subflow Input
12+
if (grGroupMember.user.sys_id != fd_data.subflow_inputs.requested_for.manager){
13+
users.push(grGroupMember.user.sys_id.toString());
14+
}
15+
}
16+
17+
return 'ApprovesRejectsAny[' + users + ']';
18+

0 commit comments

Comments
 (0)