Restrict Changing of Priority
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:34 AM
Hello All,
I am not very well versed in scripting at all and I need some help from the community.
I am trying to restrict the lowering of a priority on incident tickets by technicians (which increases the SLA).
I have created a role that I will assign to the Team Managers and I want to allow them to change the priority.
I have looked through various postings and thought the screenshot of the client script below would work but I was wrong.
Error:
We do NOT use impact and Urgency. We have 9 different Priorities (1-9)
So anyone (except a manager with the Team Manager role) would be unable to lower a priority and extend the SLA.
Increasing the priority would not be restricted.
Can anyone assist or is there a better way to do this?
Thanks in advance for your help.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 06:58 AM
Brian,
You could change the client script to just validate that the current user has the required role (Team manager) to modify the field otherwise, without that role the field is read-only. Ex:
function onLoad() {
//Type appropriate comment here, and begin script below
if(g_user.hasRole('JR - TeamManager')){
g_form.setReadOnly('priority',false);
}
g_form.setReadOnly('priority',true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 07:24 AM
Stephen,
Thanks for the response…but would that prevent them from assigning a priority or increasing the priority as well? I need them to be able to set a priority initially and also be able to increase the priority if needed.
I am very green when it comes to this scripting…..
Thanks
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 07:38 AM
Okay, let's try this....
Update line 7:
var isTeamManager = g_user.hasRole('JR - TeamManager');
Currently, the script is encountering an error because it does not understand g.hasRole.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 07:53 AM
Actually, I think this should work. Comment out line 7 and update line 8 to be:
if(!g_form.isNewRecord() && oldValue < newValue && !g_user.hasRole('JR - TeamManager')){
That should do the trick.