- 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:50 AM
Hi there,
An HR case? A CSM case? A Now Support Case? Something else?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 12:13 PM
My apologies. This is in regards to an HR case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 02:58 PM - edited 08-08-2024 01:57 AM
Hi @CLM,
Thanks for clarifying.
It’s late this end so I can provide an updated script for HR cases tomorrow morning for you, but in theory you would need to do is update the table name in the GlideRecord lookup and also update the state value (if required) to the required HR state value.
However, as HR is a scoped app and due to the security measures, this is not going to be as easy as just as the theory.
I'll take a look and get back to you.
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-08-2024 02:13 AM
Hi @CLM,
As I mentioned, due to the security constraints around HR (which should not be ignored) , I've updated the below script. This script should be copied into a Fix Script making sure your in the correct Scope: Human Resources: Core.
@CLM- Please make sure you have spoken with the HR dev/admin before running this to make sure all use cases have been thought about, related cases, SLA's reports, metrics. etc etc.
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
var reopenCaseGR = new GlideRecord('sn_hr_core_case')
reopenCaseGR.addQuery('sys_id', '477e03320b30220097432da0d5673a83'); //change to sys_id of the case you wish to update
reopenCaseGR.query();
if (reopenCaseGR.next()) {
reopenCaseGR.state = 18; //state value for Work Inprogress in HR. Feel free to update to state value you require to move to eg 10 for Open
reopenCaseGR.work_notes = 'Reopen comment. Add text here which will be visible in the Case notes';
reopenCaseGR.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 09:19 AM
Hi @CLM,
(Re posting so my latest response is not lost in the thread)
As I mentioned, due to the security constraints around HR (which should not be ignored) , I've updated the below script. This script should be copied into a Fix Script making sure your in the correct Scope: Human Resources: Core.
@CLM- Please make sure you have spoken with the HR dev/admin before running this to make sure all use cases have been thought about, related cases, SLA's reports, metrics. etc etc.
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
var reopenCaseGR = new GlideRecord('sn_hr_core_case') reopenCaseGR.addQuery('sys_id', '477e03320b30220097432da0d5673a83'); //change to sys_id of the case you wish to update reopenCaseGR.query(); if (reopenCaseGR.next()) { reopenCaseGR.state = 18; //state value for Work In progress in HR. Feel free to update to state value you require to move to eg 10 for Open reopenCaseGR.work_notes = 'Reopen comment. Add text here which will be visible in the Case notes'; reopenCaseGR.update(); }