How to hide "cancel change" button in workspace while change in implement state ?

Virendra K
Kilo Sage

HI All,

Requirement is to hide "Cancel Change" button(snap) when change request in Implement state. Already there is condition mentioned but not sure how to add that condition within in it?

What is the purpose of "(RP.getReferringURL().indexOf('/now/boc_uib/')" ? why we are using it ?

 

Condition is,

(current.u_category_type=="Networks")&&(RP.getReferringURL().indexOf('/now/boc_uib/') > -1)&&(gs.hasRole('itil') && (current.state == -3 || current.state == -4 || current.state == -5 || current.state == 29))&& ((gs.hasRole('change_manager') ||(gs.hasRole('change_jr_manager')))&& current.state == -2)

 

VirendraK_0-1731326174205.png

 

 

Regards,

Virendra

5 REPLIES 5

Abhay Kumar1
Giga Sage

@Virendra K If you want to hide the "Cancel Change" button when the Change Request is in the "Implement" state, you need to add a check for the "Implement" state (current.state == 6, assuming 6 is the state code for "Implement").

Here's how you can update your condition:

(current.u_category_type == "Networks") &&

(RP.getReferringURL().indexOf('/now/boc_uib/') > -1) &&

(gs.hasRole('itil') && (current.state == -3 || current.state == -4 || current.state == -5 || current.state == 29)) &&

((gs.hasRole('change_manager') || gs.hasRole('change_jr_manager')) && current.state == -2) &&

(current.state != 6) // Hide the button when in the "Implement" state

You can change implement value of not 6 as per available in your instance.

Hope this will help.

Hi @Abhay Kumar1 

Thanks for the input. I tried but no luck. 

But I have some findings, when I splitted the above condition and removed "&&(RP.getReferringURL().indexOf('/now/boc_uib/') > -1) " then its working as expected. 

My ask is or if you could help me understand is , what is the intention of (RP.getReferringURL().indexOf('/now/boc_uib/') > -1) this condition ? what the output we are getting through it ?

 

Thanks

@Virendra K It verifies the page where boc_uib is id of workspace.

Thanks for the explanation  @Abhay Kumar1 .

My ask is , does Workspace support (RP.getReferringURL().indexOf('/now/boc_uib/') > -1) in the condition ? any insight ?

 

Thanks