only Servicenow L1 assignment group assigned incident to servicenow L2 and L3 assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 07:15 AM
Hello Expert
only ServiceNow L1 assignment group assigned incident to ServiceNow L2 and L3 assignment group. How we can achieve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2024 07:45 AM
Hi @Rajveer ,
You can achieve this by creating a BR so that it will restrict selection of L2 and L3 groups for users who are part of L1.
Create a before insert/update BR on incident
Filter Condition: Assignment Group is one of L2, L3
(function executeRule(current, previous /*null when async*/) {
var userGroup = gs.getUser().getMyGroups();
var allowedGroup = 'ServiceNow L1';
var canAssign = false;
for (var i = 0; i < userGroup.length; i++) {
if (userGroup[i].getDisplayValue('name') === allowedGroup) {
canAssign = true;
break;
}
}
var targetGroup = current.assignment_group.getDisplayValue();
if (!canAssign && (targetGroup === 'ServiceNow L2' || targetGroup === 'ServiceNow L3')) {
gs.addErrorMessage('You are not authorized to assign incidents to L2 or L3 assignment groups.');
current.setAbortAction(true);
}
// Replace the ServiceNow L1,L2,L3 assignment group name as per your instance
})(current, previous);
Create an ACL that will control the access to the assignment group field, ensuring only L1 users can change it to L2 or L3.
it should be on incident -> assignment group field
(function() {
var userGroup = gs.getUser().getMyGroups();
var allowedGroup = 'ServiceNow L1'; // Replace with your L1 assignment group name
for (var i = 0; i < userGroup.length; i++) {
if (userGroup[i].getDisplayValue('name') === allowedGroup) {
return true;
}
}
return false;
})();
If my response has resolved your query, please consider giving it a thumbs up and marking it as the correct answer!
Thanks & Regards,
Sanjay Kumar