I want to restrict the Assign group based on COE for assigned to user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2025 07:33 AM
So when the assigned to used comes to the case then he shout only see the groups based on coe
For example
If the Case is of hr benefits case and assignment group realted to this are D, A and C
Then he can only see these 3 groups to select.
I have written a Script include and Called it via Reference qualifier
My script is not working it seems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2025 12:05 AM
@kumaar javascript:GetAllowedAssignmentGroups.getGroups(current.u_coe)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2025 12:06 AM
Let me try
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2025 12:39 AM
Ideally HR cases are not to be created directly at core HR Case table but should be on the COE tables.
this should work
Script Include:
var GetAllowedAssignmentGroups = Class.create();
GetAllowedAssignmentGroups.prototype = {
initialize: function() {},
getGroups: function(coe) {
var coeGroups = {
'sn_hr_core_case_benefits': ['TMC_HR_Tier1', 'TMC_HR_TIER1_MANAGERS', 'TMC_EXEC_SUPPORT'],
'sn_hr_core_case_total_rewards': ['TMC_HR_Tier1', 'TMC_HR_TIER1_MANAGERS', 'TMC_EXEC_SUPPORT', 'TMC_WELL_BEING_TIER3']
};
var groups = coeGroups[coe] || [];
return groups.length > 0 ? 'nameIN' + groups.join(',') : '';
},
type: "GetAllowedAssignmentGroups"
};
Ref qualifier as this -> dot walk to hr_service.service_table and pass that value
1) Remember the Assignment group field is at task level
2) so you will have to create dictionary override for HR Case table and then add the ref qualifier
javascript: new GetAllowedAssignmentGroups().getGroups(current.hr_service.service_table.toString());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader