Implement Data Retention Policies using ServiceNow System Data Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The archive and deletion rules defined below should be implemented using ServiceNow System Data Management (And these rules should be applied to the particular Service Catalog Item)
features.
Any suggestions please let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@suraj sengar
This guide outlines how to automate the archival of Service Catalog records by ensuring an entire Request hierarchy is only flagged if the parent is older than 3 years and all child records are inactive.
Firstly, I created a custom field ready to archive on the Request Table and the type is True/False.
Step 1: Create the Script Include
The Script Include validates the status of the entire record tree (Parent Request, RITMs, and Tasks) before flagging.
Navigate to System Definition > Script Includes.
Name:
CustomArchiveUtility(or your preferred name).Logic Overview: * Query the Request
[sc_request]table for records opened more than 3 years ago.Check all related Requested Items
[sc_req_item]to ensureactiveis false.Check all related Catalog Tasks
[sc_task]to ensureactiveis false.If the entire hierarchy is inactive, set the custom field
u_ready_to_archiveto true.
Step 2: Create the Scheduled Job
This job triggers the archival logic on a recurring basis to update the "Ready to archive" flags.
Navigate to System Definition > Scheduled Jobs.
Select Automatically run a script of your choosing.
Name:
Daily Archive Flagging Process.Run: Daily.
Script: Invoke the function from your Script Include
Step 3: Configure the Archive Rule
This moves the flagged data from the live tables to the archive tables.
Navigate to Data Management > Archive Rules.
Table: Request
[sc_request].Conditions:
Ready to archive [u_ready_to_archive] | is | True.Related Records: In the Archive Related Records related list, add:
Requested Item
[sc_req_item]Catalog Task
[sc_task]
Set the rule to Active.
Step 4: Configure the Destroy Rule
This defines the final data purge from the archive tables.
Navigate to Data Management > Destroy Rules.
Name:
Standard 4-Year Purge.Archive Rule: Select the Archive Rule created in Step 3.
Type: Scheduled.
Duration: Set to 4 Years (1460 days).
Note: This ensures data is purged 4 years after it enters the archive, totaling a 7-year lifecycle from the record's creation.
Set the rule to Active.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
But I need to get the same output using ServiceNow System Data Management
Is the same possible using the System Data Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@SaiAashishN - Yes , what you’ve described can be implemented using ServiceNow’s System Data Management (SDM). SDM is designed exactly for defining archive rules and delete rules on tables, with conditions to scope which records are affected. Here’s how you can align your requirement with SDM capabilities:
How SDM Works
Archive Rules: Move records from a source table into an automatically created archive table when they meet a condition (e.g., older than 3 years).
Delete Rules: Permanently remove records when they meet a condition (e.g., older than 7 years).
Conditions: You can filter by fields such as opened_at, created_on, or even by Catalog Item reference (cat_item).
Exclusions: Simply don’t define rules for excluded tables. SDM won’t touch them unless you explicitly configure rules.
Implementation Steps
Navigate to System Data Management → Archive Rules.
Create a new Archive Rule for the table linked to your Service Catalog Item.
Condition: created_on < (today - 3 years) AND cat_item = <your catalog item sys_id>.
Action: Archive.
Create a Delete Rule.
Condition: created_on < (today - 7 years) AND cat_item = <your catalog item sys_id>.
Action: Delete permanently.
Exclude Tables.
Do not configure rules for lookup/type/choice tables, sys_user, roles/groups, or any sys_ prefixed system tables without out‑of‑box rules.
Maintain a governance list of excluded tables for clarity.
Test in Sub‑Prod.
Run the rules in a lower environment first.
Verify that archive tables contain the expected records.
Confirm deletion only affects the intended records.
Refer this video - https://www.youtube.com/watch?v=ZytvntUYrDo
