Make close case button Visiable when Case is Resolved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 03:36 AM
I have a requirement where close case button needs to be visible when case is in resolved state.
There is out of box code "sn_state_flow.StateFlowFilter()).match(current, flow_id, type, true)" which is returning the value which decides close button visibility , but somehow I am not able to find the this piece of code. Kindly suggest the change which I should make so that close case button is visible in resolved state also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 03:55 AM - edited 07-29-2024 03:56 AM
Hi @ashu1612
You should check 'State Flows' on the case table with table name or search with sys_id from the flow_id in your code.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 04:30 AM - edited 07-29-2024 08:34 AM
Hi @ashu1612,
(Updated)
To answer your question directly, the 'Close Case' button (UI Action) is calling a global Script Include which is then calling a hidden class and method as you've found out.
The good news is, you can configure changes via State Flows.
Naviagte to 'State Flows' where this is managed by typing State Flows within the navigation menu.
Select the State Flow called 'Close Case' and open the record.
You'll notice it's here where the control and display is determined. Specifically, in the condition field you'll notice a call to: new CSMUtil().isCloseUIActionValid(current) - which is a call to another Script Include.
It's here where a number of conditions determine if the 'Close Case' can be displayed.
You'll notice, if you don't have one of the roles such as 'sn_esm_agent' for example, if the state is 6 (Which is Resolved), you will not see Close Case button.
To answer your follow up question, if you change this script by remove by check on line 7 "current.state == 6 ", when you upgrade, this will be something you need to manage, skip, merge or update.
So your options. If you want to stick to baseline configuration - add the user(s) to a suitable group with the correct role or update the script.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 07:27 AM
Hey Robbie
thanks for response but somehow this solution is not working I did tried this but when I resolve my case close case button is getting disappeared.
One more thing does this customization will override during upgrade?
any change made in ui action condition will override during upgrade?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 08:35 AM
Hi @ashu1612,
I've updated and slightly tweaked my response above - check it out and let me know if you have any questions.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie