
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2020 04:10 AM
Good afternoon, please can someone advise?...
I am trying to develop something that will only allow colleagues with the incident_manager role to set incidents to a P1 (impact 1, urgency 1) within the incident table. Currently anyone with an ITIL role can set incidents to a P1 which is not what we want. We do however want colleagues with the ITIL role to set P2's, P3's etc just not P1's.
Please can someone advise how to go about this? is this a business rule/acl/ dictionary override - im not sure how to tackle this. - Thank you all.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2020 04:33 AM
Good morning Toni,
You missed an ! in the condition. What you have is
if (g_form.getValue("impact") == 1 && g_user.hasRole("incident_manager")) {
That is saying reject the change for an incident manger. what you need is:
if (g_form.getValue("impact") == 1 && g_form.getValue("urgency") == 1 && !g_user.hasRole("incident_manager")) {
As I was going over your code, I realized that when either impact or urgency changes you need to check both values since they must both be 1 in order to set P1 (OOTB). The revised code can be read as if impact and urgency are 1 and the user is not an incident manager reject the chagne.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2020 04:18 AM
Hi Toni,
The easiest approach is to add a client script that checks for the role. The "gotcha" is that priority is not assigned directly so you have the choice of triggering from a change to priority and deciding how to change the value back, or you can have the two scripts, one each on impact and urgency which can check and immediately set the changed field back to it's previous value and post an error message.
As a backstop, you can have a business rule that checks before insert and update that if the inbound priority is 1 and the user an incident_manager. If not, put impact and urgency back to their previous values, post an error message and cancel the insert/update action.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2020 04:25 AM
thank you for this advise. I am looking for a bit more help if possible to provide me with script examples to implement. Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2020 04:49 AM
For the client script(s), they are On Change , one each for impact and urgency:
function onChange(control, oldValue, newValue, isLoading) {
//this will be for impact
if ((isLoading && !g_form.isNewRecord())
return;
if (g_form.getValue("priority") == 1 && !g_user.hasRole("incident_manager")) {
g_form.setValue("impact", oldValue);
g_form.addErrorMessage("You are not authorized to escalate to Priority 1");
}
}
For the business rule, it will be against the incident table and applied before insert or update:
You can set the when to run for priority changes to Critical then the BR is something like this:
var theUser = gs.getUser();
if (!theUser.hasRole("incident_manager")) {
current.impact = previus.impact;
current.urgency = previous.urgency;
gs.addErrorMessage("You are not authorized to escalate incidents to Priority 1");
current.setAbortAction(true);
}
I haven't tested the code so there may be a fat finger or two, but that's how it's done.
Hope that helps.
:{)
Helpful and Correct tags are appreciated and help others to find information faster
:{)
Helpful and Correct tags are appreciated and help others to find information faster

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2020 07:26 AM