- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 01:24 PM
I have an ask to limit who can assign a specific group (group_a) to an incident, based on the users membership in select other groups (group_x, group_y, group_z). I created a Business Rule that triggers when the Assignment group changes to group_a it runs the attached script. The problem is that the script never finds the user when they are in fact a member of one of the selected groups.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 07:54 PM - edited 09-15-2023 07:54 PM
Hi @Lance_1 ,
Try this code in your "Before" business rule.
In When to Run tab, set the condition to:
Assignment Group :: Changes To :: group_a
Im your script use the following:
(function executeRule(current, previous){
if(gs.getUser().isMemberOf('group_x') || gs.getUser().isMemberOf('group_y') || gs.getUser().isMemberOf('group_z')){
//Do nothing
} else{
gs.addErrorMessage('You are not allowed to assign to the selected assignment group');
current.setAbortAction(true);
}
})
Please mark my answer helpful, and accept as solution if it helped you to fix your issue ☺️
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 07:54 PM - edited 09-15-2023 07:54 PM
Hi @Lance_1 ,
Try this code in your "Before" business rule.
In When to Run tab, set the condition to:
Assignment Group :: Changes To :: group_a
Im your script use the following:
(function executeRule(current, previous){
if(gs.getUser().isMemberOf('group_x') || gs.getUser().isMemberOf('group_y') || gs.getUser().isMemberOf('group_z')){
//Do nothing
} else{
gs.addErrorMessage('You are not allowed to assign to the selected assignment group');
current.setAbortAction(true);
}
})
Please mark my answer helpful, and accept as solution if it helped you to fix your issue ☺️
Anvesh