Integrate with ServiceNow change management

Azure Pipelines

Azure Pipelines and ServiceNow bring an integration of Azure Pipelines with ServiceNow Change Management to enhance collaboration between development and IT teams. By including change management in CI/CD pipelines, teams can reduce the risks associated with changes and follow service management methodologies such as ITIL, while gaining all DevOps benefits from Azure Pipelines.

This topic covers:

  • Configuring ServiceNow for integrating with Azure Pipelines
  • Including ServiceNow change management process as a release gate
  • Monitoring change management process from releases
  • Keeping ServiceNow change requests updated with deployment result

Prerequisites

This tutorial extends the tutorial Use approvals and gates. You must have completed that tutorial first.

You'll also need a non-developer instance of ServiceNow to which applications can be installed from the store.

Configure the ServiceNow instance

  1. Install the Azure Pipelines application on your ServiceNow instance. You'll require Hi credentials to complete the installation. Refer to the documentation for more details on getting and installing applications from the ServiceNow store.

  2. Create a new user in ServiceNow and grant it the x_mioms_azpipeline.pipelinesExecution role.

    Creating a new user in ServiceNow

Set up the Azure DevOps organization

  1. Install the ServiceNow Change Management extension on your Azure DevOps organization.

    Installing the ServiceNow Change Management extension

    Follow the instructions to "Get it Free"

  2. Create a new ServiceNow service connection in the Azure DevOps project used for managing your releases. Enter the user name and password for the service account created in ServiceNow.

    Creating a new ServiceNow service connection

Configure a release pipeline

  1. In your release pipeline, add a pre-deployment gate for ServiceNow Change Management.

    Adding a pre-deployment gate for ServiceNow Change Management

  2. Select the ServiceNow service connection you created earlier and enter the values for the properties of the change request.

    Entering the values for properties of the change request

    Inputs for the gate:

    • Short description: A summary of the change.
    • Description: A detailed description of the change.
    • Category: The category of the change. For example, Hardware, Network, Software.
    • Priority: The priority of the change.
    • Risk: The risk level for the change.
    • Impact: The effect that the change has on the business.
    • Configuration Item: The configuration item (CI) that the change applies to.
    • Assignment group: The group that the change is assigned to.
    • Schedule of change request: The schedule of the change. The date and time should be in the UTC format yyyy-MM-ddTHH:mm:ssZ. For example, 2018-01-31T07:56:59Z
    • Additional change request parameters: Additional properties of the change request you want set. Name must be the field name (not the label) prefixed with u_. For example, u_backout_plan. The value must be a valid to be accepted value in ServiceNow. Invalid entries are ignored.

    Gate success criteria:

    • Desired state: The gate will succeed, and the pipeline continues when the change request status is the same as the value you specify.

    Gate output variables:

    • CHANGE_REQUEST_NUMBER : Number of the change request created in ServiceNow.
    • CHANGE_SYSTEM_ID : System ID of the change request created in ServiceNow.

    The ServiceNow gate produces output variables. You must specify the reference name to be able to use these output variables in the deployment workflow. Gate variables can be accessed by using PREDEPLOYGATE as a prefix. For example, when the reference name is set to gate1, the change number can be obtained as $(PREDEPLOYGATE.gate1.CHANGE_REQUEST_NUMBER).

  3. At the end of your deployment process, add an agentless phase with a task to update the status of the change after deployment.

    Adding an agentless phase with a task to update status of the change after the deployment

    Inputs for Update change request task:

    • Change request number: The number of the change request that you want to update.
    • Updated status of change request : The status of the change request that you want to update.
    • Close code and notes: Closure information for the change request.
    • Additional change request parameters: Additional properties of the change request you want to set.

Execute a release

  1. Create a new release from the configured release pipeline in Azure DevOps

  2. After completing the Dev stage, the pipeline creates a new change request in ServiceNow for the release and waits for it to reach the desired state.

    Creating a new change request in ServiceNow for the release

  3. The values defined as gate parameters will be used. You can get the change number that was created from the logs.

    Viewing the change parameter in the logs

  4. The ServiceNow change owner will see the release in the queue as a new change.

    Viewing the change release in the queue

  5. The release that caused the change to be requested can be tracked from the Azure DevOps Pipeline metadata section of the change.

    Tracking the release that caused the change to be requested

  6. The change goes through its normal life cycle: Approval, Scheduled, and more until it is ready for implementation.

  7. When the change is ready for implementation (it is in the Implement state), the release in Azure DevOps proceeds. The gates status will be as shown here:

    Viewing the gate status

  8. After the deployment, the change request is closed automatically.

FAQs

Q: What versions of ServiceNow are supported?

A: The integration is compatible with Kingston and London versions of ServiceNow.

Q: What types of change request can be managed with the integration?

A: Only normal change requests are currently supported with this integration.

Q: How do I set additional change properties?

A: You can specify additional change properties of the change request in the Additional change request parameters field. The properties are specified as key-value pairs in JSON format, the name being the field name (not the label) prefixed with u_ in ServiceNow and a valid value.

Q: Can I update custom fields in the change request with additional change request parameters?

A: If custom fields are defined in ServiceNow for the change requests, mapping of the custom fields in import set transform map must be added. See ServiceNow Change Management Extension for details.

Q: I don't see drop-down values populated for Category, Status, and others. What should I do?

A: Change Management Core and Change Management - State Model plugins must be active on your ServiceNow instance for the drop-downs to work. See Upgrade change management and Update change request states for more details.

See also

Help and support