Show Cancel Change only in implement state for change authorizer role only

Cynthia19
Tera Contributor

Hello 

 

I want to hide the create change UI button for every user in all states but make it visible for the users with the change authorizer role only in the implementing state. is this possible

 

Cynthia19_0-1695786354904.png

 

1 ACCEPTED SOLUTION

 you want cancel UI button to be visible when change state is implement and the user has role authorize_change correct?  in this case remove the other condition

Regards
Harish

View solution in original post

11 REPLIES 11

Refer below screenshot

HarishKM_0-1695788211506.png

 

Regards
Harish

Sagar Pagar
Tera Patron

Hi @Cynthia19,

 

You need to add conditions in UI action condition field as Harish mentioned.

 

gs.hasRole('change_authorizer') && current.state == '-1' // -1 is implement state value

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

@Sagar Pagar @Harish KM 

 

I  understand what I need to add to the condition  to do and I thank you both but what  there is an existing code on the condition "gs.hasRole('itil,sn_change_write') && new ChangeFormUI(current).isCancelAvailable()

 

Removing and adding this gs.hasRole('change_authorizer') && current. State == '-1', what happens to this part of the code && new ChangeFormUI(current).isCancelAvailable()" 

the third condition && new ChangeFormUI(current).isCancelAvailable() validates the state value from script include ChangeFormUISNC and function

isCancelAvailable and checks if the state can be moved to cancelled state.
Regards
Harish

Thank you Harish,

 

So my question is I want that do I have to remove? In other words, I want it to function exact same way. Only change I want to make is to allow change_authorizers to see the button in the implement state 

 

My apologies as I am new and learning