How to create a schedule job it should automatically close after 2 weeks/.

bharath3014
Kilo Contributor

Hi,

How to create a schedule job it should automatically close after 2 weeks after issue is resolved ? can someone help with scripts.

Thank you very much in advance.

1 ACCEPTED SOLUTION

lks
ServiceNow Employee
ServiceNow Employee

Hello Bharat,



There is an OOB scheduled job in table sys_trigger with name "Autoclose Incidents". Use it as a template and create a copy of it by using "Insert and Stay". Then replace "incident autoclose" in below statement with your BR script name and set the run schedule as per your choice...



fcScriptName=incident autoclose



And, you're done....



Hope this is what you were looking for?


View solution in original post

17 REPLIES 17

Hi Sneha,



Thank you for your reply. BR is already written. I have to create a Schedule job now. for the closed incidents. after 2 weeks they have to close automatically, once the incident is resolved.


Hi Bharat,



I am not getting your point. When we have this BR, it will automatically take care of Incidents which are resolved and close them in how may days you have entered.



Then what do you need in scheduled job. Please explain me this to help you.


lks
ServiceNow Employee
ServiceNow Employee

Hello Bharat,



There is an OOB scheduled job in table sys_trigger with name "Autoclose Incidents". Use it as a template and create a copy of it by using "Insert and Stay". Then replace "incident autoclose" in below statement with your BR script name and set the run schedule as per your choice...



fcScriptName=incident autoclose



And, you're done....



Hope this is what you were looking for?


lks
ServiceNow Employee
ServiceNow Employee

Hello Bharat,



I am curious to know how things are going and if you are able to create a new schedule job?


Let me know if you need further assistance!


bharath3014
Kilo Contributor

Hi Lalit,


Thank you so much....as you explained in same way i did it worked for me...Thank you so much bro. Please help me if i need any assistance in future.