Close the problem record

Hussain Basha
Tera Contributor

Gd mrg to all,

Problem records will auto Close 3 days from the date set to Resolved. All the Related incidents to the Problem will auto-close at the same time. This must also follow any existing rules defined regarding placing the Problem in Resolved status.

please help me to close the problem as well as incidents also

1 REPLY 1

saran4
Kilo Guru

You can write a scheduled scripts which will run daily 

script

 

var pr = new GlideRecord('problem');

pr.addQuery('state','value of resolved state');

pr.query();

while(pr.next()){

var now = new GlideDateTime();

var resolvedTime = new GlideDateTIme(pr.resolved);

var diff = GlideDateTime.subtract(resolvedTime,now);

var days = diff.getRoundedDayPart();

if(parseInt(days)==3){

pr.state = backend value of closed

pr.update();

}

}

please mark it as correct and helpful if mu answer satisfies your query