Close a canceled Change Request.

DevtoSME
Giga Guru

Accidently canceled a change request and I need to change the state to closed. It was actually implemented just no on the planed start date so it needed to be force closed. Is there a way to do this?

1 REPLY 1

Swapna Abburi
Mega Sage
Mega Sage

Hi @DevtoSME 

Did you try to update state and close code of change request from background script?

Sample script as below:

 

var changeNumber = 'Enter your change number';

 

// Query the change request
var gr = new GlideRecord('change_request');
gr.addQuery('number', changeNumber);
gr.query();

 

if (gr.next()) {
  gr.state = 3; //update the choice value of closed state here.
  gr.close_code = 'successful'; // Set close code to 'Successful'
  gr.update();
}