The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Auto Close Service Request after 7 days

SN Rookie
Giga Expert

Hi All,

We have a custom table (u_service_request). We want all the service requests which are in Resolved state to auto-close in 7 days similar to how it happens in Incidents. How can we achieve that?

1 ACCEPTED SOLUTION

Chalan B L
Giga Guru

Hello User,

 

Write a Schedule job for this requirement which runs every day

var query = 'state=-4^sys_updated_onRELATIVELT@dayofweek@ago@7'; //state is resolved
var gr = new GlideRecord('table_name');
gr.addEncodedQuery(query);
gr.query();

while(gr.next()){
gr.state = '3'; //set the state to closed
gr.update();
}

 

find_real_file.png

 

Mark the answer as correct and helpful if it helped you..!!

 

Regards,

Chalan

View solution in original post

6 REPLIES 6

I did follow it, do I need to create new properties or can we use the same ones?

Hi,

You have to create one schedule also to trigger the newly created business rule also.

Regards,

Munender