- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 08:51 AM
Hello Community,
Is there a way to reopen a case once it has been cancelled?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 09:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 09:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 09:46 AM
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 09:49 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 12:12 PM
My apologies. This is in regards to an HR Case.