How to Update Records in ServiceNow Without Scripting using Update Jobs
In ServiceNow, Update Jobs are part of the System Data Management module, designed to perform bulk updates on records within tables. This feature helps administrators streamline data management and ensure data accuracy across the platform. In this article, we’ll walk through how to use Update Jobs for a specific use case: updating incident records that contain the word “network” in the description but have their Category not set to network.
Use Case: Fixing Misclassified Incident Records
Problem:
You have a collection of incident records where the Description contains the word “network,” but the Category is not set to “network.” This misclassification can affect reporting, prioritization, and overall data consistency.
Goal:
To update the Category field to “network” for all incident records where the description includes the word “network” but the current Category is not “network.”
Step-by-Step Guide
1. Navigate to Update Jobs
- In the ServiceNow application navigator, search for System Data Management > Update Jobs.
- This will direct you to the list of existing update jobs and provide an option to create a new one.
2. Create a New Update Job
- Click New to create a new update job.
- Fill out the form with the following details:
- Description: Enter a description like “Update Incident Category to ‘Network’ for records with ‘Network’ in the Description.”
- Table: Select Incident from the dropdown list.
- Run business rules and engines: Set this to True if you want business rules to trigger. This ensures that automated processes tied to incidents, such as workflows, are also triggered when the update job is executed. Set to False if you don’t want business rules or engines to run.
3. Define the Conditions
To ensure that only the relevant records are updated, set the following conditions:
- Description contains the word “network”.
- Category is not “network”.
This ensures that only incidents that meet both conditions (description contains “network” and category isn’t set to “network”) will be selected for updating.
- You can add additional conditions if needed using AND or OR operators.
- Example:
- Category [is] [Software] (optional additional condition).
4. Choose Fields and Values to Update
- In the Fields & Values section, select the Category field and set the value to Network.
- This will update the Category of all selected incident records to “network.”
5. Auto Updating System Fields
- The Auto updating system fields setting is set to True by default, meaning system audit fields like
sys_updated_by
andsys_updated_on
will be automatically updated when the job runs. Set to False if you want to suppress updating these fields.
6. Preview the Update Job
- Before executing the update, it’s a good practice to Preview the job. This will allow you to see how many records match the defined conditions.
- Clicking on the link with the number of matching records will show all the records that will be affected by the job.
7. Schedule or Execute the Update Job
Once you’re confident that the conditions and fields are correctly defined, select Continue to save the update job. You’ll then have the option to either:
- Run at: Schedule the job to run at a specific time, perhaps during off-hours to minimize the impact on system performance.
- Execute Now: Execute the job immediately by clicking Execute Now.
8. Monitor the Update Job Execution
- After execution, you can monitor the results of the update job. Use the Check execution results option to view the progress and any errors encountered during the execution.
- To view the executed job later, navigate to System Data Management > Update Jobs, open the job record, and click Rollback under Related Links if you need to undo the changes.
Best Practices for Using Update Jobs
- Test in a Sub-Production Environment: Always test your update jobs in a non-production environment to ensure they work as expected.
- Backup Data: Make sure to back up important records before running bulk updates, just in case you need to restore them.
- Review Logs: After running the job, review the logs to ensure that all intended records were updated and there were no issues.
Conclusion
Using Update Jobs in ServiceNow is an efficient way to fix misclassifications in incident records, such as when the description contains “network,” but the category is not set to “network.” With the ability to preview changes, schedule updates, and roll back if necessary, Update Jobs provide administrators with a flexible tool to manage and maintain data integrity in ServiceNow. By following this guide, you can ensure that incident records are correctly categorized, improving data accuracy and reporting efficiency.