ServiceNow Approval extension

Hold Cloud Management Platform (CMP) orders for approval in ServiceNow, so an order is provisioned only once a ServiceNow approver has signed it off

The extension adds a ServiceNow Approval admin page to CMP, where you store the connection to your ServiceNow instance and map orders to the ServiceNow workflows that approve them. Orders are sent to ServiceNow as they are submitted, and a recurring job returns the decisions.

Before you start

  • Import the ServiceNow Approval extension from the Content Library and restart the Apache HTTP Server. See UI extensions for the import steps.
  • Create the approval workflow in ServiceNow. It must exist before you can add a workflow configuration.

How an approval flows

  1. A user places an order in CMP.
  2. CMP raises a matching request in ServiceNow.
  3. An approver acts on the request in ServiceNow.
  4. The next run of the recurring job reads the decision and applies it to the CMP order.
  5. When the order finishes, CMP closes the ServiceNow request.

The job runs every 30 minutes. To pick up a decision without waiting, run ServiceNow Change Order Status from Admin > Recurring Jobs.

Blueprint orders and server modification orders go to ServiceNow. An order of any other kind is approved in CMP without a request being raised. If CMP cannot raise the request, the order is canceled.

Create the workflow in ServiceNow

Build the workflow in ServiceNow’s workflow editor by following ServiceNow’s documentation, or start from the sample provided by the extension. Its conditions are set in ServiceNow, not in CMP. CMP needs only the workflow’s name and the table its requests are saved to.

To use the sample, select Download Sample WorkFlow on the ServiceNow Approval page, then in ServiceNow import the file at Service Level Management > Administration > Workflow Editor > Import XML.

Connect CMP to ServiceNow

  1. Go to Admin > ServiceNow Approval.
  2. Select Add ServiceNow Connection.
  3. Enter a Name, the IP/Hostname of the instance, and the Protocol, then the Service Account and Password CMP authenticates with.
  4. To have CMP retry a failed call, set both Retry Interval and Retry Timeout.
  5. Select Create. The connection appears under ServiceNow Connections.

Add a workflow configuration

A workflow configuration determines which ServiceNow workflow approves which CMP orders and how CMP interprets the answer.

  1. On the ServiceNow Approval page, select Add Workflow Configuration.
  2. In the Add ServiceNow Workflow dialog, select the ServiceNow Connector and a Request Type.
  3. Select the Workflow Name and the Blueprints, then select sc_request as the ServiceNow Table.
  4. Set the Approval Field Name, then the Approval Field Value and Rejection Field Value CMP reads to decide whether the order was approved or rejected, for example, the field approval holding Approved.
  5. Select Save changes. The configuration appears under ServiceNow Workflow Configurations.

A saved configuration cannot be edited. To change one, delete it and add it again.

Each configuration carries two buttons:

  • Make Default applies this configuration to any order not covered by another configuration. With no default set, an order that matches nothing does not raise a ServiceNow request.
  • Payload determines which CMP values are sent to ServiceNow with the request.

Payload variables

Select Payload on a configuration to open Modify data sent with request, a table of ServiceNow field names and the values CMP sends for them. It opens with nine common field names and no values; add and remove rows as needed, or select Reset to defaults to restore the supplied list.

CMP always sends requested_by, requested_for, description, and price with every request.

A value can be a variable, which CMP replaces with the matching value from the order.

Variable What CMP sends
{group.name} The name of the group the order was placed in.
{order.name} The name of the order awaiting approval.
{server.hostname} The hostname of a server the order will build. {server.os_build} and {server.environment} are also available.
{resource.name} The name of the item ordered from the blueprint. Also available: description, which is a summary of the order, blueprint, group, and misc_rate.

Any single field on the order or the group can be used the same way, such as {order.id}. A variable reaches one level only, so {order.blueprint.name} does not resolve.