Setting up the ServiceNow integration
Read time: 5 minutes
Last edited: Mar 07, 2023
Overview
This topic explains how to configure the LaunchDarkly ServiceNow integration for flag approvals.
The ServiceNow approvals integration is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.
Prerequisites
In order to complete this topic, you must meet the following prerequisites:
- You must have a LaunchDarkly account with a role that allows the
integration/createIntegration
role. - You must have an existing ServiceNow account with the admin role.
- You must have a ServiceNow Client ID. To learn how to create these, search for "Get the Client ID and Client Secret" in ServiceNow's documentation and choose the article for your ServiceNow version.
- You must have a secret for an OAuth API endpoint for external clients. To learn how to create these, search for "Create an OAuth JWT API endpoint for external clients" in ServiceNow's documentation and choose the article for your ServiceNow version.
- If your ServiceNow instance has IP address access control enabled, you must create inbound ServiceNow IP access control rules corresponding to the the
outboundAddresses
from LaunchDarkly's public IP list. To learn how to create IP access control rules, search for "IP Address Access Control" in ServiceNow's documentation and choose the article for your ServiceNow version.
Setting up the ServiceNow integration in LaunchDarkly
To use the ServiceNow integration to perform flag approvals, you must first establish an OAuth connection between your LaunchDarkly and ServiceNow accounts. After you create the connection, you can either:
- Configure automatic approvals or
- Configure manual approvals approvals.
To establish an OAuth connection:
- Log in to ServiceNow.
- Complete ServiceNow's instructions for creating an endpoint for external clients, including saving the redirect URL.
- Navigate to the LaunchDarkly Integrations page and find "ServiceNow."
- Click Add integration. The integration menu appears.
- Click Connect to ServiceNow. An OAuth provider registration dialog appears.
- Copy the Redirect URL to your clipboard.

- Set the Redirect URL to the redirect URL saved to your clipboard in step 2. Ensure you are following the directions for your ServiceNow version.

- In LaunchDarkly's OAuth provider registration dialog, enter your ServiceNow host URL. For example, if your ServiceNow instance is hosted at
https://launchdarkly.service-now.com
, enterhttps://launchdarkly.service-now.com
. - Enter the Client ID and Client Secret for the client you created in step 5.
- Click Register OAuth Provider.
- Click Allow. ServiceNow may prompt you to log in to your ServiceNow account at this step.
Your LaunchDarkly and ServiceNow accounts are now connected. Next, you must enable the ServiceNow approvals integration for your LaunchDarkly environment.
Configuring a LaunchDarkly environment to use ServiceNow for approvals
By default, LaunchDarkly's approvals request feature only creates approval requests in LaunchDarkly. You can change this behavior so LaunchDarkly creates change requests in ServiceNow. To do this, you must update your chosen environment's approval settings.
Here's how:
- In LaunchDarkly, navigate to the Account settings page.
- Click the Projects tab.
- Click the name of the project with the environment you wish to configure. The Environments tab appears.
- Click the overflow menu on the environment you wish to configure.
- Select Approval settings. The "Approval settings for environment" panel appears.
- Change the Approval system from "LaunchDarkly" to "ServiceNow".
- Select the ServiceNow standard change template you wish to utilize for all proposed changes in this environment. All change requests created by LaunchDarkly will include relevant details for the Short description, Justification, and Requested by fields. We recommend choosing a template with all other change request fields pre-populated.
- (Optional) Fill in the Detailed information column name field with the name of the ServiceNow Change Request column you would like LaunchDarkly to populate with detailed approval request information. This field defaults to
justification
if no value is provided. - Click Save settings.

Creating a LaunchDarkly workflow in ServiceNow for manual approvals
You can create your workflow using either of the two methods ServiceNow offers to create new workflows:
- Flow Designer
- Workflow Editor
To learn more, search for "Flow Designer" and "Workflow Editor" in ServiceNow's documentation and choose the articles for your ServiceNow version.
The screenshots below are from the Flow Designer, but you can create a workflow the same triggers, actions, and conditions using the Workflow Editor if you prefer.
To create a LaunchDarkly approvals workflow in ServiceNow:
- Create a new Workflow Trigger for record "Created" on the "Change Request [change_request]" table. To learn how to do this, search for "Create Security Operations workflow triggers" in ServiceNow's documentation and choose the article for your ServiceNow version.
- Set two conditions on your trigger: "State"
is
"New" and "Standard Change Template version > Template > Name"is
"LaunchDarkly template."

- Add a new "Ask For Approval" Action on your Trigger Change Request Record and set the approval rules.

- Add an
if
condition that requires Approval Stateis
"Approved."

- Add two "Update Change Request Record" Actions as extensions of the
if
condition.
- Set the first Action to "Update Record" with "State" "Scheduled" on the latest version of the triggering Change Request Record.
- Set the second Action to "Update Record" with "State" "Implemented" on the latest version of the triggering Change Request Record.
ServiceNow requires change request records to move through states in a certain order, so you must create two separate actions that move the record State first to "Scheduled" and then to "Implemented." The record must end in the "Implemented" state for LaunchDarkly to process the approval.

- As an extension of the
else
condition, add an "Update Change Request Record" Action that moves the "State" to "Canceled." LaunchDarkly uses this state to determine that the approval request has been rejected.

You can now request manual approvals in ServiceNow for flag changes in LaunchDarkly.

Creating a LaunchDarkly workflow in ServiceNow for automatic approvals
Automatic approval workflows create a correlating ServiceNow Change Request for any LaunchDarkly flag changes. Automatic approvals are for record-keeping only and no actual approval is requested. Automatic approval workflows resemble manual approval workflows but without the approval Action.
To create an automatic approval workflow:
- Create a new Workflow Trigger for record "Created" on the "Change Request [change_request]" table. To learn how to do this, search for "Create Security Operations workflow triggers" in ServiceNow's documentation and choose the article for your ServiceNow version.
- Set two conditions on your trigger:
- "State"
is
"New" - "Standard Change Template version > Template > Name"
is
"LaunchDarkly auto-approve template"

- Add two "Update Change Request Record" Actions as extensions of the
if
condition. - On the first Action, set the Action to "Update Record" on the latest version of the triggering Change Request Record. Set "State" to "Scheduled.""
- On the second Action, set the Action to "Update Record" on the latest version of the triggering Change Request Record. Set "State" to "Implemented."
ServiceNow requires change request records to move through states in a certain order, so you must create two separate actions that move the record State first to "Scheduled" and then to "Implemented." The record must end in the "Implemented" state for LaunchDarkly to be able to process the record.

You can now track your LaunchDarkly flag changes in ServiceNow.
