How would I limit a UI action to a certain group?

Allison3
Kilo Guru

We have a group in ServiceNow who are managers. I'm wanting to limit the OOB 'Create Outage' UI action to only that manager group. This is an OOB UI action that is activated when you activate the task-outage relationship plugin.

find_real_file.png

1 ACCEPTED SOLUTION

Condition should be something like below



(current.getRecordClassName() == 'incident' || current.getRecordClassName() == 'problem') && gs.getUser().isMemberOf('SN_IT Managers')


View solution in original post

9 REPLIES 9

nthumma
Giga Guru

Please check this answered thread


How do you restrict a button to a certain group?


Allison3
Kilo Guru

I added the group requirement and it isn't quite working. The condition now shows:


current.getRecordClassName() == 'incident' || current.getRecordClassName() == 'problem' || gs.getUser().isMemberOf('SN_IT Managers')



I impersonated an ITIL user who isn't in that group they still have the option to 'Create Outage' but when they click on it and it goes to the next screen it doesn't actually load the screen. So it appears to be blocking part of it but not all of it. I want to hide the 'Create Outage' from the form context menu from anyone not in that group.


find_real_file.png


Condition should be something like below



(current.getRecordClassName() == 'incident' || current.getRecordClassName() == 'problem') && gs.getUser().isMemberOf('SN_IT Managers')


Allison3
Kilo Guru

I limited the UI action to a user in the specified group. When I impersonate that user and create an outage it takes me to a blank screen. The user isn't able to fill out any of the fields for the Outage.


find_real_file.png


Then when I got back to the incident the outage record was created and is listed but the user isn't actually able to see it.


find_real_file.png


Any idea what is blocking them from actually seeing the incident outage form and data?


vikas48
Tera Contributor

How to achieve this if the ui action needs to be visible to user in more than one groups?
Except OR operation any other approach we can use?