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

Alikutty A
Tera Sage

Hi Bharat,



Are you talking about incident auto closure or a different table?



For incidents we have an oob feature to autoclose by setting a system property on number of days for closure



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Hi,


on table i have write the script. and i have take only closed incidents with in 2 weeks of time. after the incident is resolved schedule job should close automatically after 2 weeks.


lks
ServiceNow Employee
ServiceNow Employee

Hello Bharat,



Please elaborate your question/requirement so that we can suggest something accordingly.


bharath3014
Kilo Contributor

Hi,


on table i have write the script. and i have take only closed incidents with in 2 weeks of time. after the incident is resolved schedule job should close automatically after 2 weeks.