How to show UI action to only few Roles
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
01-17-2023 03:41 AM - edited 01-17-2023 03:42 AM
Hi ,
i have created one UI Action on incident Table to created child tasks. and the Button ' create task' should be visible to only for few users who is having few custom roles.
And i am aware that we can achieve this if we give"gs.hasRole('contract_manager') " in the condition field in UI action. But since we have many conditions we do not have any space left to give this in the condition field.
Can anyone please help me with the script to achieve this?
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
01-17-2023 03:44 AM - edited 01-17-2023 03:45 AM
There is tab on a UI action where you can list the roles required to see the UI action:
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
01-17-2023 04:03 AM
I tried that unfortunately it is not working
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
06-17-2024 08:55 PM
Hello,
Did you ever get an answer to this. It is not working for me.
Thanks.
Chad
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
08-15-2024 04:40 AM - edited 08-15-2024 04:41 AM
Hi all,
Requires Roles works (I just confirmed it), however it does work in the same way ACLs do - a user can have any of the roles listed, they do not need to have all the roles listed. Here is my configuration and it works as expected, the UI Action does not appear for users who do not have the role listed
I have encountered issues with the character limitation on the Conditions field and a way around this is to move the logic to a script include and call the script include in the condition check - ServiceNow even does this, an example is the 'Assign to me' out-of-box UI action installed with ITSM Workspace (sys id = e44b67f63b330300a2bac9bb34efc46a)
Rebecca
