Mandatory UI Policy For Certain Users

arobertson
Tera Guru

Hi All,

 

I have a UI policy that sets a few fields mandatory when a service alert is at post mortem stage. Our change manager has asked if these fields cannot be mandatory for him.

 

What would be the best way to action this? Can i set a true/false script inside the UI policy?

1 ACCEPTED SOLUTION

arobertson
Tera Guru

Managed to get it to work. I used the following code:



function onCondition() {


   


    var grpName = 'Service Assurance';


    var usrID = g_user.userID;


    var grp = new GlideRecord('sys_user_grmember');


    grp.addQuery('group.name', grpName);


    grp.addQuery('user', usrID);


    grp.query(groupMemberCallback);


   


    function groupMemberCallback(grp){


          if(grp.next()){


                g_form.setMandatory('u_actions_taken', false);


                g_form.setMandatory('u_lessons_learned___proactive_', false);


                g_form.setMandatory('u_root_cause', false);


                g_form.setMandatory('u_updated_documentation', false);


                g_form.setMandatory('u_vendor_report', false);


          }


    }


}


View solution in original post

5 REPLIES 5

Perfect


Kindly mark this thread as answered.