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

Cloning existing flags

Read time: 2 minutes
Last edited: Aug 16, 2024

Overview

You can create new flags by cloning existing flags. When you clone a flag, LaunchDarkly makes a new flag and copies the original flag's targeting configuration for all environments, including default values and whether the flag is toggled on or off. You can then modify the clone's configuration if needed.

To clone a flag:

  1. Navigate to the Flags list and open the flag you wish to clone.
  2. Click the gear icon. The flag's "Settings" page appears.
  3. In the "Clone flag" section, click Clone this flag.
  4. The "Clone feature flag" dialog appears:
The "Clone feature flag" dialog.
The "Clone feature flag" dialog.
  1. Enter a unique, human-readable Name.
  2. (Optional) Update the unique flag Key. You'll use this key to reference the flag in your code. A suggested key auto-populates from the name you enter, but you can customize it if you wish.
  3. (Optional) Enter a Description of the new flag. A brief, human-readable description helps your account members understand what the flag is for.
  4. (Optional) Click into the Tags menu and choose one or more tags for your flag.
Tags sort flags into groups

Tags are useful for managing flag permissions using custom roles. For example, you can tag a flag as "Marketing" and "DevOps," and then use these tags to determine who has read or write access for the flag. To learn more, read Custom roles.

  1. Click Save flag. You are taken to the new flag's targeting page.

The new flag appears in the Flags list.

You can also use the REST API: Copy feature flag