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.

Context Menu

monu1
Giga Contributor

What condition shall I put on VIEW context menu so that admin can see the view but itil cannot.

Actually admin has itil role by default.

Please do answer the condition .

Thank you

1 ACCEPTED SOLUTION

amlanpal
Kilo Sage

Hi Manisha,



The condition should be as of below. You just need to add the bold portion.


ListProperties.canChangeView() && gs.hasRightsTo('ui/context_menu.view/read', null) && gs.hasRole("admin")



I hope this helps. Please mark correct/helpful based on impact


View solution in original post

8 REPLIES 8

anjalichoudhary
Kilo Guru

Hi Manisha,



You can try by putting below condition:



gs.hasRole("admin")



Regards,


Anjali


snehabinani26
Tera Guru

Hi Manisha,



I dont think there is any problem if admin user has ITIL role. Problem arises when ITIL contains Admin role.



Not sure what is your requirement here.



Please elaborate.


Karthik Reddy T
Kilo Sage

Hello Manisha,



Refer the below link may helpful to you.



Customize List v2 context menus



http://wiki.servicenow.com/index.php?title=Context_Menus#gsc.tab=0


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Manisha,



What is the name of the context menu you want to show/hide based on role?


Can you explain your requirement in details?



Regards


Ankur


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