Skip to content

Conversation

@chetnadev
Copy link
Contributor

The purpose of this script in ServiceNow is to correct data inconsistencies in the Requested Items (sc_req_item) table by
identifying and updating records that are missing a reference to their associated catalog item (cat_item). Specifically, it searches for RITM records where the cat_item field is null, which typically indicates an incomplete or improperly imported record. For each of these, the script attempts to find a matching catalog item in the sc_cat_item table by comparing the RITM's short_description to the catalog item's name.
If a match is found, the script updates the RITM to reference the correct catalog item and keeps a count of how many records were fixed. This automated cleanup helps restore proper data relationships between requested items and their catalog definitions, which is important for reporting, workflows, and overall data integrity in the ServiceNow instance.

@rohi-v rohi-v assigned rohi-v and unassigned rohi-v Oct 6, 2025
@snamjosh snamjosh self-assigned this Oct 6, 2025
@snamjosh
Copy link
Contributor

snamjosh commented Oct 6, 2025

Thank you for your contribution. But, please find better solution to address this issue since it's not a good idea to lookup records using short description of catalog item. OOB, ITIL users can modify description of sc_req_item records which will break this proposed fix.

@snamjosh snamjosh closed this Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants