Hide subcategory option depending on role and group

Rairai31
Giga Guru

Hi,

I have a requirement to show a subcategory from an incident form depending on the role and group membership. This is working on SOW but not on native view, UI Type is on ALL. Can you please advise what needs to be done? Thank you.

Rairai31_2-1736735462134.png

 

Rairai31_1-1736735378178.png

 

1 ACCEPTED SOLUTION
15 REPLIES 15

@Ankur Bawiskar

Yes, that is correct.

@Rairai31 

can you try removing other choice value and see?

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

@Ankur Bawiskar 
I have made other option inactive and was not able to see that subcategory. I have also make the Swap inactive because of the addOption as mentioned by @Najmuddin Mohd

Rairai31_2-1736745959058.png

Rairai31_1-1736745936794.png

The behavior is still the same. It is showing correctly on SOW but not on native view. (Impersonated an ITIL user, Swap subcategory is not showing for both workspace and native view. Impersonated a user with asset role, Swap subcategory is showing on SOW but not on native view.)

Rairai31_0-1736745906544.png

Rairai31_3-1736746146523.png

Native view

Rairai31_4-1736747292948.png

Thank you

 

Najmuddin Mohd
Mega Sage

Hi @Rairai31 ,

Can you try by adding the Option value in the Client script itself if return condition does not match the value.

Like, if(Scratchpad == true) {

addOption;
Else{

removeOption;
}

Generally, I have used these together.


If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Hi @Najmuddin Mohd,

 

Thank you very much for your response. I have used it. It is working fine on the SOW, the Swap option is not showing if I impersonate an itil user. But when I check the native view , I can see the Swap option. Swap option should only be visible to admin, asset and Service Desk. Thank you.