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

snehabinani26
Tera Guru

HI Bharat,



Please explain the requirement. Which task you want to close or on which table and field you want to perform this action.


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.


You have this feature available oob and dont require a new scheduled job, Please set the system property to "glide.ui.autoclose.time" 14 days and the incident would auto close after 14 days of resolution.



Thank You


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


Please try this out, change its value to 14


find_real_file.png


Thank You


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


Incident already has this closure functionlity as OOB. Just change the property of this script.



instance name.service-now.com/sys_script.do?sys_id=d67b8d9ec0a80118008cd8f0f7f92fae



Incident autoclose.



find_real_file.png




Let me know why you cant use this