incident code error for urgency and impact choice list

Carol2
Tera Contributor

Hi @Ankur Bawiskar 

 

I need your expertise here.

 

I have a requirement to allow only the major incident support group users to log p1 incidents meaning the rest of the users should not see the urgency and impact p1.  The code below doesn't work instead it hides p1 for impact and urgency for the major incident support group. What did I miss?

 

see business rule below i created 

 

(function executeRule(current, previous /*null when async*/) {
g_scratchpad.grp = gs.getUser().isMemberOf('major incident support'); 
})(current, previous);

 

created a client script 

function onLoad() {
   var usr = g_user.getUserID();
   
    if (!g_scratchpad.grp) {
      
        g_form.removeOption("impact", '1'); 
        g_form.removeOption("urgency", '1'); 
	}
}

 

1 ACCEPTED SOLUTION

Hi @Carol2 ,

Business rule type will be display business rule not before business rule which you are using.

Check for the group name is correct.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

View solution in original post

8 REPLIES 8

Anand Kumar P
Giga Patron
Giga Patron

Hi @Carol2 ,

 

I already posted the inputs in my previous post with you,

Create new display Business rule with script below

AnandKumarP_0-1732559754149.png

 

Create onload client script with below script,

AnandKumarP_2-1732559904262.png

 

Output: As i am admin not part of Major incident management group i am not able to select impact and urgency as High so priority will not able to submit to P1- High incident.

AnandKumarP_3-1732559988743.png

 

AnandKumarP_4-1732560017886.png

 

 

 

Now i impersonated as Alene Rabeck who is part of Major incident management group they can see impact and urgency as 1-High, able to submit p1 incident.

AnandKumarP_5-1732560181171.png

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

 



 

Hi @Anand Kumar P 

 

Not sure what I am missing the urgency 1 and impact 1 is hidden for everyone. Check below steps:

 

Business rule 

Carol2_0-1732604802581.png

Carol2_1-1732604819641.png

 

Client script 

Carol2_2-1732604884680.png

 

Group details

Carol2_3-1732604909441.png

Carol2_4-1732604929669.png

 

Impersonated Andre Och from the application development group impact/urgency 1 is hidden

Carol2_7-1732605523706.png

 

Me as admin urgency/impact 1 hidden/removed

Carol2_8-1732605606592.png

 

Regards 

Ca

 

 

 

Regards 

Ca

 

 

Impersonated Andre Och since he is part of the "application development" group the p1 priority and urgency is not showing which is not correct. 

Carol2_5-1732605047732.png

Me as admin also cannot see the impact/urgency p1

Carol2_6-1732605115980.png

 

 

 

 

 

Hi @Carol2 ,

Business rule type will be display business rule not before business rule which you are using.

Check for the group name is correct.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

@Anand Kumar P @OlaN 

Thanks for all your help the issue was the Business rule running on "Display"