Amit Gujarathi
Giga Sage
Giga Sage

Automating Annual Standard Change Reviews

Introduction

In today's fast-paced business environment, organizations often implement changes to their IT infrastructure through standard change processes. These changes undergo rigorous approval processes to ensure smooth operations. However, it is essential to periodically review these standard changes to assess their effectiveness and make any necessary adjustments. This article discusses how ServiceNow can help automate the annual review process for standard changes, ensuring compliance and continuous improvement.

 

Understanding the Business Requirement

The business requirement is to review each standard change one year after its approval. To facilitate this process, three custom fields have been added to the system:

  1. Annual Standard Change Review Date: This field stores the date when the annual review is due. It is calculated by adding one year to the creation date of the change request.
  2. Reviewed: This field is a Boolean (true/false) flag indicating whether the change has been reviewed.
  3. Last Review: This field stores the date when the last review took place. It is set to the creation date of the change request.

 

Creating the Business Rule

To automatically calculate the "Annual Standard Change Review Date" and set it for each standard change, follow these steps:

  1. Navigate to the table where the "Standard Change" records are stored, typically named "Standard Change" or similar.
  2. Create a new business rule on the "Standard Change" table and configure it to run on record creation.
  3. In the script section of the business rule, write the necessary code to calculate the "Annual Standard Change Review Date" using the addYears() function. Here's an example code snippet:

 

var oneYearLater = gs.dateGenerate(gs.nowDateTime(), "year", 1);
current.setValue('annual_standard_change_review_date', oneYearLater);

 

  1. Save the business rule.

Setting up the Scheduled Job

To trigger the review process on the annual review date, follow these steps:

  1. Access the "Scheduled Jobs" section in ServiceNow.
  2. Create a new scheduled job with a suitable name, such as "Annual Change Review Job."
  3. Set the execution frequency to run daily.
  4. In the script section of the scheduled job, write the code to query for standard changes where the "Annual Standard Change Review Date" matches the current date (Today). Set the "Reviewed" field to false and create a new ticket for the review. Here's an example code snippet:

 

var gr = new GlideRecord('standard_change');
gr.addQuery('annual_standard_change_review_date', gs.nowNoTZ());
gr.query();

while (gr.next()) {
  gr.setValue('reviewed', false);

  // Create a new ticket using a suitable method or API call
  // For example:
  // var newTicket = new GlideRecord('incident');
  // newTicket.initialize();
  // newTicket.setValue('short_description', 'Annual Review Required');
  // newTicket.insert();

  gr.update();
}

 

  1. Save the scheduled job.

Conclusion

Automating the annual review process for standard changes in ServiceNow is crucial for organizations aiming to maintain compliance and optimize their IT operations. By following the steps outlined in this article, you can create a business rule to calculate the "Annual Standard Change Review Date" and a scheduled job to trigger the review process on the specified date. This automation not only saves time but also ensures that no review is missed, providing a systematic approach to improve change management.

 

Version history
Last update:
‎05-25-2023 10:29 AM
Updated by:
Contributors