We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Condition on Service Portal Menu Item to only show to users with Roles?

Wendy Peterson
Tera Guru

I have a menu item i need to put a condition on that only shows to users with Roles it doesn't matter the role they just have to have them. Any ideas on what that condition would be? TIA

1 ACCEPTED SOLUTION

Try: gs.getUser().getUserRoles().toArray().length>0

View solution in original post

4 REPLIES 4

Raghav Sharma24
Giga Patron

Use the below condition as per your requirement

 

gs.hasRole('itil')||gs.hasRole('itil_admin')

find_real_file.png

How would I change that to "Any Role" we have to many to list out. It's a menu item that links back to the client side away from our portal we only show to Users with Roles. TIA

Try: gs.getUser().getUserRoles().toArray().length>0

That worked Thank You