Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to limit the reference field values?

UdbhavS
Tera Contributor

In the incident form there is a reference field configuration items, which when open from incident form then we can see 3000+ CIs. How can we make it in such a way that for users with not admin role should be able to see only those CIs whose class is Computer only?

 

I tried below code in reference qualifier but it didn't work.....

 

javascript:

if (gs.hasRole('admin')) {
answer = 'sys_class_nameISNOTEMPTY';
} else {
answer = 'sys_class_name=cmdb_ci_computer';
}
return answer;

1 REPLY 1

SVimes
Kilo Sage

OOTB, the field is inherited from Task so something specific to Incident would be a Dictionary Entry Override (sys_dictionary_override) which you would see in the Dictionary Overrides related list when attempting to configure the field.

 

What I see in my PDI is the override has the reference qualifier set to javascript:new TaskUtils().getConfigurationItemFilter(current); which is a Script Include that has both a SNC and non-SNC version. Use the non-SNC version to override what is in the SNC version so you get what you need more appropriately.

Sable Vimes - CSA