Need Fix Script to close state the Incident from Resolved State.

Shekhar Deshin1
Mega Guru

Hi,

We have issue with business rule of Auto Closer of Closed incident after 5 Business days.

Incident state doesn't change from Resolved to Closed after 5 days.We have bulk of tickets which is already in Resolved however those are not getting auto close after 5 days according to out of box business rule.

Can some please suggest on work around Need Fix Script OR background script to close the Incident which is already Resolved State.

Thanks,

Shekhar,

1 ACCEPTED SOLUTION

Ruchit
Mega Sage

Please use below Fix script/ background script to change the state from resolved to closed

 

 

closeIncidents();
function closeIncidents() {
var gr = new GlideRecord("incident");
gr.addEncodedQuery("stateIN6");
gr.setWorkflow(false);
gr.query();
while (gr.next()) {
gr.state = 7;
gr.close_notes = "Manually closing ticket from resolved state";
gr.update();
}
}

View solution in original post

1 REPLY 1

Ruchit
Mega Sage

Please use below Fix script/ background script to change the state from resolved to closed

 

 

closeIncidents();
function closeIncidents() {
var gr = new GlideRecord("incident");
gr.addEncodedQuery("stateIN6");
gr.setWorkflow(false);
gr.query();
while (gr.next()) {
gr.state = 7;
gr.close_notes = "Manually closing ticket from resolved state";
gr.update();
}
}