i want to restrict the users to create and update p1 and p2 tickets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 04:03 AM
Hi Team,
i have a requirement like, i want to restrict the users to create and update the p1 and p2 tickets.
only 2 groups people only able to create and update the tickets.
how can i achieve this. can anyone help me on this with a script.
may be acl is works for this.
regards,
chinna
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 04:30 AM
Its not removing the option, its just hiding from them
Abhishek Gardade
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 04:37 AM
Hello
You can use a BR for this
it would be something like this
On before script and in condition select priority is one of(p1,p2)
var permitted_groups =[<group sys_id>];
var flag = false;
var group_count = permitted_groups.length;
for (var i=0; i< group_count ; i++){
if(gs.getUser().isMemberOf(permitted_groups[i]))
{ flag = true;
break;
}
}
if(!flag)
{
gs.addErrorMessage('You are not authorised to create Incident with Priority P0/P1.');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 04:45 AM
Hi Chinna
Create a BR which will run on Before Update :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if ((!gs.getUser().isMemberOf("group 1") || !gs.getUser().isMemberOf("group 2")) && (current.getValue('priority') == '1' || current.getValue('priority') == '1'))
{
gs.addErrorMessage('you dont have the right to update P1 and P2 tickets');
current.setAbortAction(true);
}
})(current, previous);
Mark correct if this resolves ur query
regards,
ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 09:00 AM
- Restricting the user to create P1 tickets
- Create an onChange client script,
- This script will make an Ajax call to a script include
- Verify if the user belongs to the group
- Based on the response, show a message and take appropriate actions
- Restricting the user to Update P1 tickets
- This can be achieved using ACL
- Write an ACL script that returns false if the user does not belong to the group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2022 10:34 PM
I have a query , only some users we need to provide the access to create P1 incidents. If not we need to send a alert message and revert the impact and urgency to pervious values using Client script.