Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to identify changes in the CI state

sattar3
Tera Contributor

Hello Everyone,

 

I’m working on a story where I need to identify when a Configuration Item (CI) installation state changes to Absent and understand where this behavior is configured within the ServiceNow system.

 

  • I want to configure a data model that updates a CI to Retired if it remains in an Absent state and is not rediscovered within 90 days for 5classes.


Please help me here the best way to do it and if any scheduled scripts needs to configured for orphan CIs.

 

Thanks,
Sattar

2 REPLIES 2

Tanushree Maiti
Kilo Patron

Hi @sattar3 

 

Refer this Get Well Playbook : KB0829106 Active CIs Updated in Last 90 days 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

NasserAlBalus
Kilo Contributor

To track when a CI moves to Absent and retire it after 90 days, you can handle it in two parts.

First, detect the state change. Create a Business Rule on the CI table such as cmdb_ci. Set it to run on update and check if the installation_status changes to Absent. You can log the date in a custom field like

absent_since.

 

Second, handle the 90 day logic. Create a Scheduled Script Execution that runs daily. It should query CIs where installation_status is Absent and absent_since is older than 90 days. If the CI has not been rediscovered, update installation_status to Retired.

 

For multiple classes, either include them in the query condition or create a base class rule that applies to all 5 classes.

 

Also check Discovery settings and any existing CMDB Health or Get Well Playbooks since some cleanup logic may already exist.

 

This approach avoids orphan CIs and keeps your CMDB clean automatically.