Hello all, We have two incidents and those two incidents are in cancelled state and state in changed

Tulasiram1
Kilo Guru

Hello all, We have two incidents and those two incidents are in cancelled state and state in changed to read only mode. Now my question is can we change state to close from cancelled for those two incidents.

 

Tulasiram1_0-1706623446696.png

 

3 REPLIES 3

piyushsain
Tera Guru
Tera Guru

Hi @Tulasiram1 

You have to run a background script to update it

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

shubhamdubey
Mega Sage

@Tulasiram1 

 

Yes we can do this follow this code.

Try this code in background script.closed.PNG

 

var gr = new GlideRecord('incident');
gr.addEncodedQuery('state=8');
gr.query();
while(gr.next()){
    gr.close_code ='known error';
    gr.close_notes = "closed incident";
    gr.state= 7 ;

    gr.update();
}
 
cancelled.PNG

shubhamdubey
Mega Sage

@Tulasiram1 

 

Any feedback , have u tried that code ?/