Make re-open the chance_request record when state is closed

harivas
Tera Contributor

I have to make reopen the change request record when state is closed.

The change request record state closed to all other states how can I achive this?

can any one help me on this query

thanks
Harivas.G

7 REPLIES 7

Sohail Khilji
Kilo Patron
Kilo Patron

OOTB change do not have re-open button. For this requirement you need to create a new UI Action on change table which sets the state of the change back to draft and the visiblity conditon will be if current.state == '6' // what ever is your number for close.

 

NOTE : YOU MAY NEED TO ADMEND CERTAIN CHANGES TO STATE TRANS...

 

Here is the UI action :

 

(function(){

if(current.state == '3'){

current.state = '2';  //which ever is draft state
current.update();
gs.setRedirectUrl(current);
}

})();
	

 

SohailKhilji_0-1711881439889.png

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Sumanth16
Kilo Patron

Hi @harivas ,

 

1. Create a UI Action called "Move to Draft" on change_request table

2. Add condition current.state==5;//update closed state value

2. Script:

new Workflow().deleteWorkflow(current);
current.state = '-6';//choice value equivalent to draft in your environment
current.update();

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @harivas 

 

Greetings!!

 

Even though solution has been provided by experts but

- What is is business case for this?

- Once a change reopen, in which state you want, as change has 5-6 states. 

- What about the task closed in last state? 

- Who can re-open the change?

- What about the close code ?

 

 

Point to consider

- It will impact the flow badly.

- It has direct impact on process / roles.

- Re-opening of change may impact the KPI's 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

harivas
Tera Contributor

@Sohail Khilji , @Sumanth16 , @Dr Atul G- LNG  Thanks for your reply.

@Dr Atul G- LNG  when the user accidentally closed is should be rolled back,the user wants to go to any state. that's what our customers is asking.