Skip to content
Closed
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
18 changes: 18 additions & 0 deletions Server-Side Components/Script Includes/DepartmentFilter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Department Filter – Show Only Users from Same Department

This Script Include is configured to filter users based on the department of the currently logged-in user.

It can be used in a **Reference Qualifier** to ensure that the Caller (or any user reference field) displays only users belonging to the same department as the logged-in user.

### 📘 Table
- `sys_user` (to fetch users)
- Used for reference fields such as `caller_id` in `incident`

### ⚙️ Script Include Overview
- Name: `getSameDeptUsers`
- Function: `getSameDept()`
- Logic: Fetches all users whose `department` matches that of the current logged-in user.

### 🧩 Example Usage (Reference Qualifier Script)
```javascript
javascript:new getSameDeptUsers().getSameDept();
Loading