Reopen Case

CLM
Tera Contributor

Hello Community,

 

Is there a way to reopen a case once it has been cancelled?

1 ACCEPTED SOLUTION

Sumanth16
Kilo Patron

Hi @CLM ,

 

It is not best practice to reopen Cancelled case. Ask user to create another new case.

 

But if you want to do it ,try to reopen using background script:

 

var gr= new GlideRecord('sc_request')//change to case table

 

gr.addQuery('sys_id', 'sample sys_id');//change to case sysid

 

gr.query();

 

while(gr.next()) {

 

        gr.request_state="open";//update to your state number

 

  new WorkflowApprovalUtils().cancelAll(gr, "comment");

 

var wf1 = new global.Workflow();

 

wf1.restartWorkflow(gr,true);

 

        gr.update();



}

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Thanks & Regards,

Sumanth Meda

 

View solution in original post

10 REPLIES 10

Sumanth16
Kilo Patron

Hi @CLM ,

 

It is not best practice to reopen Cancelled case. Ask user to create another new case.

 

But if you want to do it ,try to reopen using background script:

 

var gr= new GlideRecord('sc_request')//change to case table

 

gr.addQuery('sys_id', 'sample sys_id');//change to case sysid

 

gr.query();

 

while(gr.next()) {

 

        gr.request_state="open";//update to your state number

 

  new WorkflowApprovalUtils().cancelAll(gr, "comment");

 

var wf1 = new global.Workflow();

 

wf1.restartWorkflow(gr,true);

 

        gr.update();



}

 

if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Thanks & Regards,

Sumanth Meda

 

CLM
Tera Contributor

Thank you!

Robbie
Kilo Patron
Kilo Patron

Hi @CLM,

 

When you state to re-open a 'case', are you referring to a CSM (Customer Service Management) case?

As @Sumanth16 mentioned, it's not as simple as simply reopenning... have you considered any SLA's, emails etc that may be triggered or reporting effects?

 

If however you still want to proceed, here's a script that will update the case for you. Run as a backkground script.

 

var reopenCaseGR = new GlideRecord('sn_customerservice_case') 
reopenCaseGR.addQuery('sys_id', 'aa6c5270db0d330092daf3c61d961998'); //change to sys_id of the case you wish to update
reopenCaseGR.query();
if (reopenCaseGR.next()) {
    reopenCaseGR.state = 10; //state value for open in CSM. Feel free to update to state value you require to move to
	reopenCaseGR.work_notes = 'Reopen comment. Add text here which will be visible in the Case notes';
	//reopenCaseGR.autoSysFields(false); //Uncomment this field as 
    reopenCaseGR.update();
}

 

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

CLM
Tera Contributor

My apologies. This is in regards to an HR Case.