Auto close changes records

Akhil32
Tera Contributor

Hi Team,

Here is my use case:

“Auto-close any change record that has been in the Implement state for more than 24 hours after its planned end date and time has passed. The change should be closed with the close code Unsuccessful and the close code reason Abandoned.”

Need some suggestions to implemented this, I know we do it via scheduled script. is there any other way to achieve this using flow designer. not familiar with flows

Give some suggestions
8 REPLIES 8

tiagomacul
Giga Sage

Automating the lifecycle of Change records is a critical step toward operational efficiency. While many organizations still rely on legacy Scheduled Scripts, the modern architectural approach in ServiceNow is to utilize Flow Designer. This ensures the solution is easier to maintain, audit, and upgrade.

 

 

Based on industry best practices and official frameworks, here is the recommended approach to satisfy this requirement:

 

1. Using Flow Designer (The Modern Approach) Flow Designer is the 'Out-of-the-Box' (OOB) standard for this type of automation. It eliminates the need for complex scripting and provides a clear visual representation of the logic.

  • Trigger: Set the trigger to 'Daily' or 'Repeat' at a specific interval.

  • Look Up Records: Use the 'Look Up Records' action to find Change Requests where:

    • State is 'Implement'

    • Planned end date is relative 'before' 24 hours ago

  • For Each Loop: Iterate through the results and use the 'Update Record' action to:

    • Set State to 'Closed'

    • Set Close code to 'Unsuccessful'

    • Set Close notes to 'Abandoned'

 

2. Why Flow Designer over Scheduled Scripts? From an Enterprise Architecture perspective, choosing Flow Designer aligns with Pillar 5 (Data Governance) and ensures a sustainable 'TO-BE' state:

  • Traceability: Every execution is logged, providing a clear audit trail of why a Change was closed.

  • Maintainability: Business stakeholders can understand the logic without needing to read JavaScript code.

  • Upgrade-Safe: Flows are less likely to break during platform upgrades compared to custom scripts.

 

https://www.slideshare.net/slideshow/servicenow-incident-auto-close-configuration-pdf/275085671

 

Hi Tiago Macul,
Thanks for the suggestion. I’ll try it with Flow Designer and check the results.

Georgian R_
Tera Contributor

What you need is a flow that will look up for all the change records in state implement and planed end date before 24 hours ago & not empty. Add closed notes as you wish.

GeorgianR__0-1768833229562.png

 

Hi Georgian,
Could you please provide more snippets of the flow, if possible elaborate actions(steps).

Thank you