Hi I want to Hide few fields in Incident form for certain groups in servicenow how can i achieve this thourght UI policy or ACL or Business rule.

siddharth26
Tera Guru

Hi all,

 

I want to Hide few fields in Incident form for certain groups accessing it in servicenow. how can i achieve this thorough UI policy or ACL or Business rule.

 

thanks

Siddharth

1 ACCEPTED SOLUTION

Glad that it worked.

Would you mind marking my response as correct & helpful if I am able to resolve your query?

Regards
Ankur

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

View solution in original post

27 REPLIES 27

Hi,

you can configure system property to hold those group sys_ids

then query sys_user_grmember with the logged in user and group

Regards
Ankur

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

So post creating a system property ('ABC' name) include the below change only to be done in Display BS rule logic

 

g_scratchpad.isMember = gs.getUser().sys_user_grmember('ABC');//system property name

Hi,

your system property would hold comma separated sys_ids of groups

so if you want to check if user is member of any of that group then you need to have gliderecord like this

var gr = new GlideRecord('sys_user_grmember');

gr.addQuery('user', gs.getUserID());

gr.addQuery('group', 'IN', gs.getProperty('property name'));

gr.query();

g_scratchpad.isMembeOfAtleast1Group = gr.hasNext(); 

Regards
Ankur

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

Hello Ankur

I've created the system property BS Rule and Client Script as mentioned but the the fileds are visible to the user of one of the assignment groups (when I impersonated) to check

 

Hello Ankur

your below suggestion helped!

var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('user', gs.getUserID());
gr.addQuery('group', 'IN', gs.getProperty('property name'));
gr.query();
g_scratchpad.isMembeOfAtleast1Group = gr.hasNext();

 

what chages to be included to apply the same for hiding a related list and UI Action button (from those same set of assginment groups - for which I've created a system property)