Contents Now Platform Administration Previous Topic Next Topic Schedule a script execution Subscribe Log in to subscribe to topics and get notified when content changes. ... SAVE AS PDF Selected Topic Topic & Subtopics All Topics in Contents Share Schedule a script execution Non-conditional and conditional scripts can be scheduled. Procedure Navigate to System Definition > Scheduled Jobs. Click New. Select Automatically run a script of your choosing. Populate the following fields: Table 1. Schedule script execution Field Input Value Name A name to identify this scheduled script execution Active If true, the script will be executed at the scheduled date and time. Run The type of schedule to execute the script on. Choices are: Daily Weekly Monthly Periodically Once Day If Run is Weekly, the day of the week If Run is Monthly, the day of the month. Repeat Interval If Run is Periodically, the duration between each script execution.Note: This setting does not account for Daylight Savings Time changes. For example, if you select a period of one day, this adds 24 hours to the starting time of the job. If the start time was configured during a period with Daylight Savings Time, the job executes with a one hour offset on days when that time zone is not in Daylight Savings Time. Time If Run is Daily, Weekly, or Monthly, the time of day, based on a 24 hour clock. Starting The date and time of the first scheduled script execution. Application The application that contains the script.) Conditional If checked, the entity will only be executed if certain conditions are met. Condition If Conditional is checked, a script determines under what conditions the scheduled script is executed. The last expression of the script should evaluate to a Boolean (true/false) value. Run as [Optional] Select another user to run the script execution as. Configure the form to add this field if it is not present. Run this script The script to run at the scheduled date and time. For example, copy script logic from a business rule or call a script include. Example: Example The following is an example of a conditional script. This example runs the scheduled job only if there are active Incidents older than 30 days. // Only run this Scheduled Job if there are active Incidents over 30 days old var ga = new GlideAggregate('incident'); ga.addAggregate('COUNT'); ga.addQuery('active', 'true'); ga.addQuery('sys_created_on', '<', gs.daysAgo(30)); ga.query(); ga.next(); ga.getAggregate('COUNT') !== '0' Related TasksSchedule a reportSchedule the generation of an entityCreate a scheduled jobView a schedule itemRelated ReferenceSpecial cases in job schedules On this page Send Feedback Previous Topic Next Topic
Schedule a script execution Non-conditional and conditional scripts can be scheduled. Procedure Navigate to System Definition > Scheduled Jobs. Click New. Select Automatically run a script of your choosing. Populate the following fields: Table 1. Schedule script execution Field Input Value Name A name to identify this scheduled script execution Active If true, the script will be executed at the scheduled date and time. Run The type of schedule to execute the script on. Choices are: Daily Weekly Monthly Periodically Once Day If Run is Weekly, the day of the week If Run is Monthly, the day of the month. Repeat Interval If Run is Periodically, the duration between each script execution.Note: This setting does not account for Daylight Savings Time changes. For example, if you select a period of one day, this adds 24 hours to the starting time of the job. If the start time was configured during a period with Daylight Savings Time, the job executes with a one hour offset on days when that time zone is not in Daylight Savings Time. Time If Run is Daily, Weekly, or Monthly, the time of day, based on a 24 hour clock. Starting The date and time of the first scheduled script execution. Application The application that contains the script.) Conditional If checked, the entity will only be executed if certain conditions are met. Condition If Conditional is checked, a script determines under what conditions the scheduled script is executed. The last expression of the script should evaluate to a Boolean (true/false) value. Run as [Optional] Select another user to run the script execution as. Configure the form to add this field if it is not present. Run this script The script to run at the scheduled date and time. For example, copy script logic from a business rule or call a script include. Example: Example The following is an example of a conditional script. This example runs the scheduled job only if there are active Incidents older than 30 days. // Only run this Scheduled Job if there are active Incidents over 30 days old var ga = new GlideAggregate('incident'); ga.addAggregate('COUNT'); ga.addQuery('active', 'true'); ga.addQuery('sys_created_on', '<', gs.daysAgo(30)); ga.query(); ga.next(); ga.getAggregate('COUNT') !== '0' Related TasksSchedule a reportSchedule the generation of an entityCreate a scheduled jobView a schedule itemRelated ReferenceSpecial cases in job schedules
Schedule a script execution Non-conditional and conditional scripts can be scheduled. Procedure Navigate to System Definition > Scheduled Jobs. Click New. Select Automatically run a script of your choosing. Populate the following fields: Table 1. Schedule script execution Field Input Value Name A name to identify this scheduled script execution Active If true, the script will be executed at the scheduled date and time. Run The type of schedule to execute the script on. Choices are: Daily Weekly Monthly Periodically Once Day If Run is Weekly, the day of the week If Run is Monthly, the day of the month. Repeat Interval If Run is Periodically, the duration between each script execution.Note: This setting does not account for Daylight Savings Time changes. For example, if you select a period of one day, this adds 24 hours to the starting time of the job. If the start time was configured during a period with Daylight Savings Time, the job executes with a one hour offset on days when that time zone is not in Daylight Savings Time. Time If Run is Daily, Weekly, or Monthly, the time of day, based on a 24 hour clock. Starting The date and time of the first scheduled script execution. Application The application that contains the script.) Conditional If checked, the entity will only be executed if certain conditions are met. Condition If Conditional is checked, a script determines under what conditions the scheduled script is executed. The last expression of the script should evaluate to a Boolean (true/false) value. Run as [Optional] Select another user to run the script execution as. Configure the form to add this field if it is not present. Run this script The script to run at the scheduled date and time. For example, copy script logic from a business rule or call a script include. Example: Example The following is an example of a conditional script. This example runs the scheduled job only if there are active Incidents older than 30 days. // Only run this Scheduled Job if there are active Incidents over 30 days old var ga = new GlideAggregate('incident'); ga.addAggregate('COUNT'); ga.addQuery('active', 'true'); ga.addQuery('sys_created_on', '<', gs.daysAgo(30)); ga.query(); ga.next(); ga.getAggregate('COUNT') !== '0' Related TasksSchedule a reportSchedule the generation of an entityCreate a scheduled jobView a schedule itemRelated ReferenceSpecial cases in job schedules