Incident Priority high tickets can be created only by a particular group

pravee26
Kilo Contributor

Creating new Incident tickets with high priority can be done only by 'service Desk' group members.If any other support group members attempt to create priority high incident tickets then pop up should be displayed stating 'you dont have access to create this ticket' and ticket should not be created. How to achieve this? I wrote this ACLACL.png

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Praveena,



ACL won't restrict showing/hiding the drop down values for a particular field. Here is the approach:



1) Have onSubmit client script


2) Get value of priority


3) Determine if logged in user is part of 'service Desk' group. this will be a flag either true/false


4) if (priority == 'high' && flag == true){


alert("you dont have access to create this ticket");


return false; // this will stop user from submitting the form


}



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

nayanawadhiya1
Kilo Sage

Hey Praveena,



Instead of ACL, write onLoad Client Script if the current user is a member of that groups then they see the 1-Critical and 2- High option in the Priority list otherwise remove the options using -


g_form.removeOption('Field_name',Option_value);


Hi Nayan, I am trying to do the same thing as Praveena was. I've tried writing the onLoad Client Script but don't know how to write it. Can you share the details? I will add a screen shot of mine, but I'm getting an error. Thank you!


How do we call isMemberOf() from clientside?


if(g_scratchpad.grp !='true' && priority == 'high')


{


......Write your validations here as required


g_form.removeOption('Field_name',Option_value);



}