Create/manage flags in the UI

5 minute read

Feature flags enable development teams to progressively toggle features on and off for specific user segments. Flags are defined as Boolean, number, or string types. You can create flags in either the UI or in your application code.

Flag settings

Flag names are case-sensitive and must exactly match in both your source code and the platform UI. Each flag requires a type and a unique name. These values cannot be changed after creation. Flags are scoped to the application in which they are created and are not shared across applications.

Table 1. Flag settings apply to a flag in all environments.
Flag setting Definition Required? Editable?

Name

The flag name.

Description

Any descriptive information about the flag.

Type

The flag type: Boolean, string, or number.

Variation (string or number flags only)

One or more possible predefined flag values. Each value must be the appropriate type. For example, the string value test is a variation for a string flag, and 234 is a variation for a number flag.

Label

A way of organizing flags. For example, tag all flags administered by a specific developer team with the same label.

Mark as permanent

Set a flag, for example, a timeout or URL flag, to permanent status to ignore its impression data.

Access the flag overview

Flags are managed at the application level. Each application is linked to one or more environments.

To view a list of flags for an application:

  1. Select Feature management.

  2. By default the Flags overview page displays.

  3. The Flags overview page lists all flags for the selected Application.

    Default display for Flags overview page
    Figure 1. Default display for the Flags overview page.

No flags displayed?

If the list appears empty, it may mean:

  • No flags have been created for the selected application.

  • A different application or environment is selected.

Display options

Flags are available in the environments linked to the selected application. For more information, refer to How flags relate to environments.

The following image shows the Flags overview page and highlights the available display and configuration options.

Flags overview page options
Figure 2. Flags overview page with available options.

Descriptions for each numbered option are listed below:

  1. Select and manage application-level feature flag resources:

    • Select Application to choose which application’s flags, target groups, and properties to display.

    • Use Installation instructions to set up the SDK if not already configured.

    • Navigate between the Flags, Target groups, and Custom properties tabs to manage feature configurations and metadata for the selected application.

  2. Access configuration tools and filter options:

    • Use the Connect your configuration as code (CasC) link to integrate with GitHub and manage flags declaratively.

    • Select Copy icon to copy the environment-specific SDK key for use in your application code.

      Your SDK key identifies a specific environment within an application and is required to evaluate flags at runtime. Refer to unique environment identifier for more information.
    • Use Filters to narrow results by environment, label, status, and other attributes.

    • Search for flags by name, view cleanup candidates, or select Create flag to add a new one.

      The number of available cleanup candidates is displayed per total number of flags.

  3. Review and manage individual flags:

    • View all flags in the selected environment, including their configuration status, labels, impressions, and activity status.

    • Use icon vertical ellipsis dark to edit, configure, delete, or view audit history for individual flags.

Filter flag lists

Filter flags in an environment according to the following criteria:

Table 2. Feature flag filters
Filter Possible options Reference

Configuration status

  • Off

  • On

Flag type

  • Boolean

  • Number

  • String

Label

Any existing label

Namespace

Any existing namespace

Activity status

  • Setup

  • Active

  • Stale

  • Inactive

  • Permanent

To filter flags:

  1. Select Filter. The available filters are displayed.

  2. You may apply one or more filters by selecting an option. Refer to the table above for filter descriptions.

  3. Filter by environment when the application is linked to multiple environments.

  4. Search by flag name.

The results include a list of flags that match your filtering criterion.

Create a flag in the UI

Once a flag is created it is available across all environments that are linked to the application.

Once you create a flag, you cannot edit its name or its data type.

To create a flag:

  1. Select Feature management.

  2. Select Create flag.

  3. Enter a flag Name.

  4. Enter a Description.

  5. Select a Type from the options.

    1. Enter a value of the appropriate data type for your flag.

    2. For string and number type flags, define variations, as follows:

    3. Select Define variations.

      • If Define variations is selected, then Add variation is enabled.

      • The Add variation option allows the flag to toggle between multiple values, not just true or false.

    4. Select Add variation to enter another value.

      You may enter unlimited variations.

      Create flag variations
      Figure 3. Creating a flag, with variations highlighted.
  6. Enter Labels.

  7. Select Permanent flag if appropriate.

    • The Permanent flags option ignores impression data and are excluded from cleanup filters. This is useful for flags that serve a static purpose, such as enabling logs or setting timeouts.

    • Examples for use could be, timeout flags, URLs or logging levels. It could also be flags that are always intended to be on or off in production, not part of an A/B test or gradual rollout.

  8. Select Save.

    Once created, the flag is listed in the Flags overview page.

  9. Enable the flag configuration by turning the configuration status to On.

Create a flag in code

Create a flag in your source code and run your application. Your newly created flag is displayed in the platform feature management flag list. Refer to Create flags in code to learn more.

Update flag settings

Add to, remove, or edit any flag setting.

To update flag settings:

  1. Select Feature management.

  2. Select Vertical ellipsis next to the flag you want to edit.

  3. Select Edit.

  4. Update the Description, variations, or Labels.

    • Select the next to a variation to remove it, or delete all variations at once by selecting Define variations.

    • Remove a label from a flag by selecting the "X" next to the label name.

  5. Select Update.

The flag setting(s) are updated accordingly.

Delete a flag

To delete a feature flag, you must first turn off its configuration in all environments. A deleted flag is completely removed from the CloudBees platform, including all environments, and deletion is irreversible.

The flag activity status informs users of the flag lifecycle across all environments, helping them make an informed deletion choice.

Select Show cleanup candidates in the Flags dashboard to display all flags with stale or inactive status. These flags are often a good choice for deletion.

To delete a flag:

  1. Select Feature management.

  2. Select Vertical ellipsis next to the flag you want to delete.

  3. Select Delete.

  4. Select the toggle next to the flag to disable the flag configuration for all environments.

  5. Select Delete.

The selected flag is deleted and removed from the flag list.

Filter stale and inactive flags

You can filter stale and inactive flags, known as cleanup candidates, within any environment. Cleaning up these flags by deletion often reduces tech debt. The number of candidates per total flags is listed next to the filter.

To filter cleanup candidates:

  1. Select Feature management from the left pane.

  2. Select Show cleanup candidates.

The list of flags is filtered to display only those with Stale or Inactive activity status.