Skip to content

Commit 387498c

Browse files
Create README.md
1 parent d09071b commit 387498c

File tree

1 file changed

+24
-0
lines changed
  • Server-Side Components/Script Includes/Dynamic Approval Routing Based on Organizational Hierarchy

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dynamic Approval Routing Based on Organizational Hierarchy
2+
3+
## Overview
4+
5+
This Script Include provides a dynamic way to determine approval routing based on a user's organizational hierarchy, including their manager, department head, and role-based approvers. It is designed to be used in workflows, business rules, or Flow Designer actions to automate complex approval chains.
6+
7+
## Features
8+
9+
- Retrieves a user's manager as an approver.
10+
- Adds department head if available.
11+
- Includes role-based approvers (e.g., Finance Head for users with `finance_approver` role).
12+
- Easily extendable for other roles or organizational logic.
13+
14+
## Usage
15+
16+
### Script Include: `ApprovalRouter`
17+
18+
Call the `getApprovers(userId)` method to retrieve a list of approver `sys_id`s.
19+
20+
```javascript
21+
var router = new ApprovalRouter();
22+
var approvers = router.getApprovers(current.requested_for.toString());
23+
24+
gs.info('Approvers: ' + approvers.join(', '));

0 commit comments

Comments
 (0)