Use ServiceNow to automate the creation of a runbook
Last Updated: October 7th, 2024
Problem Statement
Cutover runbooks can be created manually using the user interface, however there are many cases where you may want to automatically create a runbook, as a result of approving a new ServiceNow change.
Solution
The functionality in ServiceNow allows you to create ServiceNow business rules that can be utilized to trigger and copy a runbook from a newly approved Change Request or a newly created incident.
Key Benefits
- Move through Cutover at speed
- Save time and effort
- Less room for error
- Ability to respond in real time
Configuring your ServiceNow Business Rules
This section provides guidance on how to create your ServiceNow Business rules. The business rule will trigger when you approve a change request and copies a new runbook from a template. This happens in real time.
Prerequisites
1. You will need to ensure you’re a ServiceNow Administrator with the ability to manage business rules and create change requests.
2. You will need Workspace Runbook Creator or Folder Runbook Creator in the appropriate workspace to create a new runbook.
Steps for creating the ServiceNow Business Rules
In order to create the ServiceNow business rules, you will need to follow the steps below:
1. Create your business rule to trigger and copy a runbook from a template.
2. Test your business rule.
Create your business rule to trigger and copy a runbook from a template
Once the prerequisites are met, you can create your new ServiceNow business rule by following these steps:
1. Navigate to System Definition - Business Rules > click New.
2. You will see a page as shown in the screenshot below:
In the When to run section, update the business rule to reflect the changes shown in the screenshot above.
Note: The business rule will only trigger when a change request is updated and set to approved.
3. Click on the Advanced tab and paste in the sample code below in the script section. You will need to ensure you set the correct variables, cutover base url and bearer token.
4. Please ensure you save your Business Rule.
Test your business rule.
1. Now you're ready to test your business rules. Navigate to the Change Requests page > Click New
Choose the Change Request type that you would like to raise > Fill out the Change Request form as shown above. Please ensure the Short Description, Description, Planned start date and Planned end date is set. These fields need to be populated to trigger the business rule.
2. Once your change request has been approved the business rule will trigger and a runbook will be copied.
Note: As shown below, the runbook has been created with Short description and Change Number added to the runbook title in Cutover. Also, the runbook has kicked off at the same time as the date and time set in the Planned start date in ServiceNow.