How to restrict UI Action "View" in incident form?

Naveen Kumar
Tera Contributor

I need to show Ui Action "View" to only "itil" users.

and other users should not see this UI Action.

 

NaveenKumar_2-1672733023735.png

 

How to find this UI Action and add conditions.

1 ACCEPTED SOLUTION

KrishnaMohan
Giga Sage

Hi @Naveen Kumar  

 

Navigate to system UI -> UI Context Menus

filter the column name with 'view'

KrishnaMohan_0-1672734734606.png

open the form and you will see condition field, you can apply the conditions.

KrishnaMohan_1-1672734772387.png

 

To know more about customize list context menus, explore serivcenow docs product link

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/navigation-an...

 

If this helps, please mark this as correct/helpful.

 

Thanks,

Krishnamohan

 

View solution in original post

4 REPLIES 4

GodOfWar
Mega Guru

You can't have the best solution for that approach. I suggest you provide them a separate view for their role. 

Community Alums
Not applicable

Hi @Naveen Kumar  ,

Try the below

(function overrideView(view, is_list) {

if( (gs.hasRole('admin')) && !(gs.hasRole('itil')) ){
answer = 'finance_custinc'; // set the new view to answer
}

})(view, is_list);

 

Also, https://www.servicenow.com/community/developer-blog/managing-access-to-ui-actions-with-conditions-ro...

 

KrishnaMohan
Giga Sage

Hi @Naveen Kumar  

 

Navigate to system UI -> UI Context Menus

filter the column name with 'view'

KrishnaMohan_0-1672734734606.png

open the form and you will see condition field, you can apply the conditions.

KrishnaMohan_1-1672734772387.png

 

To know more about customize list context menus, explore serivcenow docs product link

https://docs.servicenow.com/en-US/bundle/tokyo-platform-administration/page/administer/navigation-an...

 

If this helps, please mark this as correct/helpful.

 

Thanks,

Krishnamohan

 

scott barnard1
Kilo Sage

"view" is restricted to users with the view_changer role.

If you don't want people changing view then remove this role from them.