Skip to main content

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Overview

This topic explains how to configure the LaunchDarkly ServiceNow integration for flag approvals.

Prerequisites

In order to complete this topic, you must meet the following prerequisites:

Integration permissions in Launch

DarklyYou must have a LaunchDarkly account with a Writer, Admin, Owner, or a custom role that allows the createIntegration action on the integration resource.

Admin permissions in Service

NowYou must have an existing ServiceNow account with the admin role.

IP address access in Service

NowIf your ServiceNow instance has IP address access control enabled, you must create inbound ServiceNow IP access control rules corresponding to 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. For example, if your ServiceNow version is Zurich, read IP Address Access Control.

Create a Service

Now standard change templateTo begin, create a ServiceNow standard change template that you want to use for all proposed changes originating from LaunchDarkly. We recommend creating a dedicated template for LaunchDarkly changes. To learn how to propose a new standard change template, search for “Propose a standard change template” in ServiceNow’s documentation and choose the article for your ServiceNow version. For example, if your ServiceNow version is Zurich, read Propose a standard change template. If you do not use a ServiceNow standard change template, we recommend using the Custom approvals integration instead.

Create an application registry entry in Service

NowNext, create an application registry entry in ServiceNow. This provides the OAuth Client ID and Client Secret you will use when you set up the integration in LaunchDarkly. To do this, first find the Redirect URL in LaunchDarkly:
  1. In LaunchDarkly, navigate to the Integrations page and find “ServiceNow.”
  2. Click Configure. The integration menu appears.
  3. Click Connect to ServiceNow. An OAuth provider registration dialog appears.
  4. Copy the Redirect URL to your clipboard.
You will use this redirect URL when you create the application registry entry in ServiceNow. To learn how to create the application registry entry, search for “Create OAuth API endpoints for external clients” in ServiceNow’s documentation and choose the article for your ServiceNow version. For example, if your ServiceNow version is Zurich, read Create OAuth API endpoints for external clients. When you save the new entry, ServiceNow displays the Client ID and Client Secret for this application. Save these for use in the integration setup section.
The ServiceNow external client endpoint registration form with the Redirect URL configured.
We recommend using a generic service account to create the application registry entry in ServiceNow. In ServiceNow change requests created by LaunchDarkly approval requests, the ServiceNow account associated with the OAuth client appears in the Requested by field.The LaunchDarkly member who creates the approval appears in the Short description field.Here’s an example:
A ServiceNow change request created by LaunchDarkly, with the ServiceNow and LaunchDarkly requestors called out.

Set up the Service

Now integration in LaunchDarklyTo 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:
  1. In LaunchDarkly, navigate to the Integrations page and find “ServiceNow.”
  2. Click Configure. The integration menu appears.
  3. Click Connect to ServiceNow. An OAuth provider registration dialog appears.
LaunchDarkly's ServiceNow OAuth provider registration form.
  1. Enter your ServiceNow host URL. It may look something like https://launchdarkly.service-now.com.
  2. Enter the Client ID and Client Secret from the ServiceNow application registry entry you saved in the application registry step.
  3. Click Register OAuth Provider.
  4. 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, enable the ServiceNow approvals integration for your LaunchDarkly environment.

Configure a Launch

Darkly environment to use ServiceNow for approvalsBy 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. The ServiceNow approvals integration supports approval requests for feature flag changes only. Here’s how:
  1. Click the project dropdown. The project menu appears:
The project menu.
  1. Select Project settings. The list of project settings appears.
  2. Click Approval settings.
  3. In the “Flag approvals” section, select an environment.
  4. Click Edit approval setting. The “Approval settings for [environment]” dialog appears.
  5. Change the Approval system from “LaunchDarkly” to “ServiceNow.”
  6. 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.
  7. (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 you do not provide a value.
  8. (Optional) Select the Require approvals for this environment checkbox to require approval for flag targeting changes in this environment. If you select this, then you must also choose:
  • Whether to require approval for all flags, or only for flags matching the provided tags. While tags are global across environments, this setting applies only to flags in the current environment.
  • Whether to allow scheduled changes for a flag to be deleted without approval in this environment.
  1. Choose whether to Automatically apply flag changes in LaunchDarkly when associated external change requests are approved.
  2. Click Save changes.
LaunchDarkly environment approval settings with ServiceNow configured.

Create a Launch

Darkly workflow in ServiceNow for manual approvalsYou can create your workflow using either of these two ServiceNow workflow creation methods:
  • Flow Designer
  • Workflow EditorTo 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:
  1. 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.
  2. Set two conditions on your trigger: “State” is “New” and “Standard Change Template version,” “Template,” “Name” is “LaunchDarkly template.”
A configured Workflow Trigger in the ServiceNow Flow Designer.
  1. Add a new “Ask For Approval” Action on your Trigger Change Request Record and set the approval rules.
A ServiceNow "Ask For Approval" action configuration.
  1. Add an if condition that requires Approval State is “Approved.”
A ServiceNow if condition configured for change request approvals.
  1. 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” “Implement” 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 “Implement.” The record must end in the “Implement” state for LaunchDarkly to process the approval.
A ServiceNow update change request record action that moves the "State" to "Scheduled."
  1. 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.
A ServiceNow update change request record action that moves the "State" to "Canceled."
You can now request manual approvals in ServiceNow for flag changes in LaunchDarkly.
A complete ServiceNow workflow for LaunchDarkly manual flag approvals.

Create a Launch

Darkly workflow in ServiceNow for automatic approvalsAutomatic 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:
  1. 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.
  2. Set two conditions on your trigger:
  • “State” is “New”
  • “Standard Change Template version,” “Template,” “Name” is “LaunchDarkly auto-approve template”
A Workflow Trigger in the ServiceNow Flow Designer.
  1. Add two “Update Change Request Record” Actions as extensions of the if condition.
  2. On the first Action, set the Action to “Update Record” on the latest version of the triggering Change Request Record. Set “State” to “Scheduled.”
  3. 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 “Implement.” The record must end in the “Implement” state for LaunchDarkly to be able to process the record.
A ServiceNow update change request record action that moves the "State" to "Implemented."
You can now track your LaunchDarkly flag changes in ServiceNow.
A completed ServiceNow workflow for LaunchDarkly "automatic" approvals.