To access and manage a scheduled job in ServiceNow, you'll navigate to the Scheduled Jobs module, where you can either open an existing job for viewing and editing or initiate the creation of a new one.
Accessing and Managing Scheduled Jobs in ServiceNow
Scheduled jobs in ServiceNow automate various tasks, from running scripts to generating reports. Understanding how to "open" them means knowing how to find, view, modify existing ones, or create entirely new automated processes.
Navigating to Scheduled Jobs
The first step to interacting with any scheduled job is to locate the dedicated module within your ServiceNow instance.
- Log in to your ServiceNow instance as an administrator or a user with the appropriate roles (e.g.,
admin
,schedule_admin
). - In the Navigator filter (the search bar on the left-hand side), type "Scheduled Jobs."
- From the search results under System Definition, select Scheduled Jobs.
This action will display a list of all scheduled jobs configured in your instance, providing an overview of their status and next run times.
Opening and Editing an Existing Scheduled Job
Once you've navigated to the "Scheduled Jobs" list, you can easily open any existing job to review its configuration or make necessary modifications.
- Locate the Job: Use the search bar or filters at the top of the list to find the specific scheduled job you wish to open. You can filter by name, active status, last run time, or other criteria.
- Click to Open: Click on the Name of the scheduled job from the list. This will open its record form, displaying all its details and configuration settings.
When viewing an existing scheduled job, you will see fields such as:
- Name: The unique identifier for the job.
- Active: Whether the job is currently enabled or disabled.
- Run: How frequently the job runs (e.g., Daily, Weekly, On Demand).
- Time: The specific time of day the job is scheduled to execute.
- Application: The scope of the application the job belongs to.
From this form, you can perform several key actions:
- Update: Save any changes you've made to the job's configuration.
- Run Now: Manually trigger the scheduled job to execute immediately, overriding its scheduled time.
- Delete: Remove the scheduled job from the system (use with caution).
- Generate Event: For jobs configured to generate events.
Creating a New Scheduled Job
If your goal is to set up a new automated task, ServiceNow provides a straightforward process for creating new scheduled jobs. This is essential for expanding automation capabilities within your instance.
- After navigating to the "Scheduled Jobs" list as described above, click the New button, typically located at the top of the list view.
- Select the Type: You'll be prompted to choose the type of scheduled job you want to create. Common types include:
- Automated Script: Executes a server-side JavaScript.
- Report: Generates and distributes a report.
- Job: Executes a specific job (e.g., a system maintenance job).
- Workflow: Triggers a ServiceNow workflow.
- URL: Opens a specified URL.
- Fill in Details: Complete the required fields on the new job form. These fields will vary slightly depending on the job type selected but generally include:
- Name: A descriptive name for your job.
- Run: Specify the recurrence (e.g., Daily, Weekly, Monthly, Once, On Demand).
- Time: The exact time for execution.
- Conditional: Set a condition that must be true for the job to run.
- Script (for Automated Script type): The JavaScript code to be executed.
- Click Submit to save your new scheduled job.
Common Scheduled Job Types
Scheduled Job Type | Description | Typical Use Cases |
---|---|---|
Automated Script | Runs server-side JavaScript code. | Data cleanup, custom integrations, bulk updates, data synchronization. |
Report | Generates and distributes reports to specified recipients. | Daily performance reports, weekly incident summaries, compliance reports. |
Job | Executes a predefined system job. | Database maintenance, cache flushing, log rotation. |
Workflow | Triggers a ServiceNow workflow. | Automating business processes, record creation, approvals. |
URL | Navigates to a specified URL, often used for external integrations. | Triggering external systems via webhooks, data fetching. |
Practical Insights for New Scheduled Jobs
- Descriptive Naming: Always use clear and concise names that indicate the job's purpose, making it easier to identify and manage later.
- Testing: Thoroughly test any script or configuration in a non-production environment before deploying to production.
- Error Handling: Implement robust error handling within your scripts to prevent issues and log failures effectively.
- Monitoring: Regularly review job logs and monitor their execution to ensure they run as expected and identify any performance bottlenecks.
- Documentation: Document the purpose, functionality, and dependencies of complex scheduled jobs for future reference and troubleshooting.
Understanding Scheduled Job Components
Regardless of whether you are viewing, editing, or creating, understanding the core components of a scheduled job is crucial for effective management.
- Name: A unique and descriptive label.
- Active: A checkbox to enable or disable the job. Inactive jobs will not run.
- Run: Defines the frequency:
- Daily: Runs every day.
- Weekly: Runs on specific days of the week.
- Monthly: Runs on specific days of the month.
- Periodically: Runs at defined intervals (e.g., every 5 minutes).
- On Demand: Only runs when manually triggered (via "Run Now").
- Once: Runs only once at the specified time.
- Time: The exact time of day for job execution.
- Conditional: An optional field where you can specify a condition (e.g.,
gs.hasRole('itil')
) that must evaluate to true for the job to execute. - Script (for Automated Script): The JavaScript code block that the job will execute.
- Application: The scope in which the scheduled job operates.
By following these steps, you can efficiently open, manage, and create scheduled jobs, harnessing the automation capabilities of your ServiceNow instance.