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 08:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 08:24 AM
Good deal, glad I could help.
Don't forget to hit like, helpful or correct for my response and for future community members who have similar questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2018 08:08 AM
Stephen,
You helped.
That got rid of the errors. But wasn't functioning properly. Then I noticed some errors in my script and modified as shown below.
I then noticed that even if the person didn't have the role, when reducing the priority, the message appeared and it disallowed the change.
I appreciate all your help. You have been great
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
var isTeamManager = g_user.hasRole('JR - Team Managers');
if (!g_form.isNewRecord() && oldValue < newValue && (!g_user.isTeamManagers))
{
alert('Your manager is required to lower the incident priority. Please contact your manager');
g_form.setValue('priority', oldValue);
return false;
}
else{
return;
}
}