Close the servicenow incidents automatically. Is it possible?

1.7k views Asked by At

Could anyone please tell me if there is a way to close the servicenow incidents automatically through automation process.

I am dealing with bulk p3 incidents daily. I want to figure out a way to reduce the manual effort.

Thank you Pushpanth

2

There are 2 answers

3
giles3 On

You could write JavaScript to find and close the Incidents, and run it from a scheduled job.

var grInc = new GlideRecord('incident');
// Add filtering logic here ...
grInc.addQuery( ...
grInc.addQuery( ...
grInc.query();
while (grInc.next()) {
    grInc.state = 7; // Closed
    grInc.update();
}

OR

If you do not want to write any JavaScript, you could do it using Flow Designer: (https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/concept/flow-designer.html)

1
user22750156 On
var gr = new GlideRecord('sc_task');

gr.addQuery('number','TASK0594091');
gr.query();

while (gr.next())
{
    gr.state = 10;
    gr.update();
}