- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 08:26 AM
Hi,
Im trying to create a dynamic filter when choosing the caller field on the incident table.
I want to show all incidents that created from callers that share department like the login user, but i had no luck.
This is before using the filter:
After using the filter(for some reason Im only getting incident that created by Abel but Dolev is also from my department):
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 09:12 AM
@Alon Grod Are you sure, if you are using the dynamic filter correctly. Here is how I created a dynamic filter to show the incidents from the user who are from my department.
Here is the script include code.
var GetUsersFromDepartment = Class.create();
GetUsersFromDepartment.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMyDepartmentUsers:function() {
var userArray = [];
var glideUser = new GlideRecord('sys_user');
glideUser.addActiveQuery();
glideUser.addQuery('department', gs.getUser().getDepartmentID());
glideUser.query();
while (glideUser.next()) {
userArray.push(glideUser.getValue('sys_id'));
}
return userArray;
},
type: 'GetUsersFromDepartment'
});
Here is how I am calling this script include from the script field of the dynamic filter.
new global.GetUsersFromDepartment().getMyDepartmentUsers();
Here is how the dynamic filter should be applied on the incident list.
Hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 09:12 AM
@Alon Grod Are you sure, if you are using the dynamic filter correctly. Here is how I created a dynamic filter to show the incidents from the user who are from my department.
Here is the script include code.
var GetUsersFromDepartment = Class.create();
GetUsersFromDepartment.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMyDepartmentUsers:function() {
var userArray = [];
var glideUser = new GlideRecord('sys_user');
glideUser.addActiveQuery();
glideUser.addQuery('department', gs.getUser().getDepartmentID());
glideUser.query();
while (glideUser.next()) {
userArray.push(glideUser.getValue('sys_id'));
}
return userArray;
},
type: 'GetUsersFromDepartment'
});
Here is how I am calling this script include from the script field of the dynamic filter.
new global.GetUsersFromDepartment().getMyDepartmentUsers();
Here is how the dynamic filter should be applied on the incident list.
Hope this helps