- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 11:51 PM - edited 12-11-2024 12:21 AM
Hi team,
i have requirement to show only department based assignment groups for assigning to assignment group based on current logged user --> groups department
Please advice
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 03:23 AM
This should give you all assignment groups where the department is the logged in user's groups department:
var UserGroupUtils = Class.create();
UserGroupUtils.prototype = {
getUserGroupDepartments: function() {
var userGroupDepartments = [];
var grGroupMember = new GlideRecord('sys_user_grmember');
grGroupMember.addQuery('user', gs.getUserID());
grGroupMember.addQuery('group.active', true);
grGroupMember.query();
while (grGroupMember.next()) {
// Replace u_department with the required field name
var groupDepartment = grGroupMember.group.u_department.toString();
userGroupDepartments.push(groupDepartment);
}
// Replace u_department with the required field name
return 'u_departmentIN' + userGroupDepartments.toString(); // Query containing all assignment groups where u_department is one of the logged in user's groups department
},
type: 'UserGroupUtils '
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 12:14 AM
How are you relating departments to groups?
And how well has this requirement been thought through? A ticket comes in at the ServiceDesk. That agent is of the IT department, but the ticket is meant for the HR department. He can't assign it, because he can't see the the HR department assignment groups.
This will cause huge issues, because more often than not, it is a different department that needs to resolve a ticket, when the assignment group is changed.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 12:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 12:19 AM - edited 12-11-2024 12:20 AM
Hi @vamshi2
One way to achieve this is -Use a Reference Qualifier
Set the Reference Qualifier to Dynamic
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 12:25 AM
Hi @raj chavan
Thanks for the reply but users are not directly mapped to department it is mapped via group