hide impact options when user have certain roles

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
onLoad Client Script

3 REPLIES 3

Jitendra Diwak1
Kilo Sage

Hi @marrikruthi,

 

Please try this below code

 

function onLoad() {

// Check if user has the required role
if (!g_user.hasRole('incident_impact_urgency_write ') {
// Remove high and medium impact options
g_form.removeOption('impact', '1'); // High impact
g_form.removeOption('impact', '2'); // Medium impact
}
}

 

Please accept my solution if it resolves your issue and thumps 👍 up 

 

Thanks 

Jitendra 

no it is not working

 

Hi could you please share your script.