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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 03:53 AM - edited 11-11-2024 03:56 AM
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)
Regards,
Virendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 04:12 AM
@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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 05:32 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2024 07:18 AM
@Virendra K It verifies the page where boc_uib is id of workspace.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2024 02:24 AM
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