Restricting who can submit/upgrade a Priority 1 Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2012 07:32 AM
I have a requirement to restrict the ability to submit a P1 incident or upgrade an incident to a P1 to a select couple of groups. Initially I created an onSubmit client script to restrict this by role and it worked.....to an extent. Through testing I realized that I didn't account for anyone actually working these incidents and also restricted the ability to comment/work them.
I will include the client script below for all to see. Basically, I am just looking for input on how to account for actually working these incidents or determine a better way to accomplish this requirement. Thanks.
function onSubmit() {
var isOps = g_user.hasRole('Ops_SD');
var priority = gel('incident.priority');
if (priority.value == 1){
if (isOps)
return true;
if (!isOps){
alert('You do not have the necessary role to open a Priority 1 incident. \n\nContact the Service Desk at xxx-xxx-xxxx to open a Priority 1 incident.');
return false;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2012 08:19 AM
How 'bout an onLoad script that removes/disables the Priority 1 option if the current value is not already Priority 1, and the user doesn't have the required role?
Remove an option with g_form.removeOption("priority", "1");
Maybe show a field message with g_form.showFieldMsg("priority", "Contact the Service Desk to open a P1", "info");
You may also want to create a business rule that aborts the update under the same circumstances, to account for list editing the Priority field from a list, or to account for someone setting priority using an email containing a line like "priority:1".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2012 08:33 AM
Thanks for the comment!
I actually failed to mention that I did go down that road but ran into issues. The issue being that even with the option removed, setting the Impact and Urgency high enough sets the Priority to 1.
I also looked to see if I could do something via ACLs but it didn't look like I could go that granular. Maybe you can though.
Also, thanks for the list edit and inbound email tips. I will certainly consider those.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2012 08:20 AM
I had a little bit of time to take a look at this again. Using the advice provided here I came up with a simpler solution that fulfills the required request.
function onLoad() {
var isOps = g_user.hasRole('Ops_SD');
var priority = g_form.getValue('priority');
if (!isOps && (priority != 1)){
g_form.removeOption("priority", '1');
g_form.removeOption("impact", '1');
}
}
I suppose the lesson to be learned here is to try not and over think a solution.