No results for ""
EXPAND ALL
  • Home
  • API docs

GIVE DOCS FEEDBACK

Viewing, comparing, and copying flag settings

Read time: 4 minutes
Last edited: May 14, 2024

Overview

This topic explains how to view flags across multiple environments, and compare and copy flag settings between two environments.

View flags across multiple environments

Viewing a flag across multiple environments allows you to compare the targeting and recent evaluations of your feature flag at a glance.

To view a flag across multiple environments:

  1. Navigate to the flags list.
  2. Click the + next to your current environment to display the list of environments, and select the environment you want.
The environment selection menu.
The environment selection menu.

LaunchDarkly adds the selected environment to your flags list. You can compare recent activity and whether the flag is toggled on or off. For each environment, you can also hover for additional details including variations served, default values when on, and default off variation:

Flag evaluation information available on hover, for the Production environment.
Flag evaluation information available on hover, for the Production environment.

You can also use the REST API: Get flag status across environments

Compare and copy flag settings between two environments

Copying flag settings is an Enterprise feature

Copying flag settings is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.

You can compare and copy a flag's settings between two environments. To learn how to clone a flag, rather than just copy its settings, read Clone flags.

To compare and copy a flag's settings:

  1. Navigate to the flags list. Click the three-dot overflow menu for one of the environments you want to compare.
The environment overflow menu.
The environment overflow menu.
  1. Choose Compare flags. The "Flag comparison" screen appears.
  1. Choose a Source environment from the menu. This is the environment you will be copying flag settings from.
  2. Choose a Target environment. This is the environment you will be copying flag settings into. A list of flags appears indicating the differences between the two environments:
The "Compare flags" screen with two environments selected.
The "Compare flags" screen with two environments selected.
Contexts and segments are environment-specific

Individual targeting and segment targeting are specific to an environment. Even if two different environments have a context or segment with the same name in each environment, LaunchDarkly treats them as distinct. For example, if a flag targets two segments both named "Beta users" in two different environments, LaunchDarkly displays an exclamation point icon indicating a difference in targeting rules between the two environments.

  1. Click a flag's row to view how the flag's settings differ between the two environments. The current flag settings for the target environment appear in the first column, and the proposed flag settings for the target environment appear in the second column.
  2. Select checkboxes to choose which settings you would like to copy from the source environment:
The comparison screen with a checkbox called out.
The comparison screen with a checkbox called out.
  1. Click Copy settings. Or, optionally click the more options menu and select "Request approval" to send an approval request for your changes.

Your settings are now copied into the target environment.

If the environment you're copying changes to requires approval, you will be prompted to request approval from another member. To learn more, read Approvals.

Restrictions on custom targeting rules

You can copy all custom targeting rules simultaneously with the Select all checkbox. However, if one of your rules references a segment that does not exist in the target environment, you cannot copy any targeting rules. You will still be able to copy Targeting state, Prerequisites, Individual context targets, the Default rule when on, and the default off variation ("If targeting is off, serve").