Allow user with certain role to Update an incident assigned to specific assignment group.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I have created Custom Role "update_a". I need to allow only users with this role to update incident assigned to assignment group "B". I am trying to use business rules for this. Any Suggestions how can I achieve this.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @Cindy Sim ,
Create write ACL on incident record and write code in script section to check following conditions.
1) logged in user has role "update_a"
2) current record's (i.e. incident) assignment group is "B"
// Check if user has role 'uupdate_a' and assignment_group is 'B'
gs.hasRole('update_a') && current.assignment_group.name == 'B';
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
33m ago
Hi @Cindy Sim
May you try via Client script > onSubmit
function onSubmit() {
var groupName = g_form.getDisplayValue('assignment_group');
if (groupName === 'B') {
var hasRole = g_user.hasRole('update_a');
if (!hasRole) {
g_form.addErrorMessage("You are not allowed to update incidents assigned to group B."); //optional
return false; // Not allow submit
}
}
return true; // Allow submit
}