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.

Hide high and medium options in impact field when selected user doesnt have certain roles as below

marrikruthi
Tera Contributor

When a user is creating a new incident record, if he does'nt have the incident_impact_urgency_write role remove high and medium impact options from incident form using client script.

1 REPLY 1

Sid_Takali
Kilo Patron

Hi @marrikruthi Try below onLoad Client Script code

if(g_form.isNewRecord()){
var isAdmin = g_user.hasRole('incident_impact_urgency_write');
	if (!isAdmin){
		g_form.removeOption('impact', '1');
               g_form.removeOption('impact', '2');
	}
}