Manage Target Groups

Updated 4 months ago by Archana Singh

This topic describes how to add a Target Group to your environment. Target Groups allow you to serve flag variations to a list of targets in bulk.

The Target Groups are a collection of targets. You can group targets into a group by either picking individual targets or define rules that would automatically map targets to a target group. For example, you can add individual targets xyz@harness.io and abc@harness.io to be part of the QA internal users group. Or define a rule that all the emails ending with @harness.io to be part of the QA internal users group.

In this topic:

Before You Begin

Step 1: Create a Target Group

Perform the following steps to create a target group:

  1. In Feature Flags, click Target Management, click Target Groups.
  2. Click + Target Group.
  3. In Create a Target Group, enter a Name for your target group and click Create.

Once you have created a target group you need to add targets to your target group. You can group targets into a group by either picking individual targets or define rules that would automatically map targets to a target group.

Option 1: Add Individual Targets to a Target Group

Perform the following steps to add targets to a Target Group:

  1. Select a target group and click Edit.
  2. In Rules, click Edit Rules.
  3. In Individual Targets, in Include the following, select the targets that you want to include in your Target Group.
  4. In Individual Targets, in Exclude the following, select the targets that you want to exclude from your Target Group.
  5. Once you are done, click Save.

Option 2: Add Targets to a Target Group Based on Conditions

In addition to targeting individual users, Harness Feature Flags also allows you to target a group of users based on the conditions. You can add conditions by constructing rules as the following:

  • an attribute, which defines the scope of the flag's impact, such as only impacting an email address.
  • user value, which identifies a user or resource by a value you specify, such as @harness.io.
  • an operator, which sets differentiating characteristics of the attribute, such as limiting the attribute to emails that end with certain extensions.

    The following operators are supported:

    Operator

    Attribute Type

    Definition

    starts with

    string

    string prefix match

    ends with

    string

    string suffix match

    contains

    string

    substring match

    equals

    number or string

    matches the string or number

    equals (sensitive)

    number or string

    matches the string and is case-sensitive. For example,  the string HELLO is different from the string hello

    in

    target group names

    user is included or excluded by the targeting rules for the named target groups.

Perform the following steps to add target to a target group based on the rules:

  1. Select a target group and click Edit.
  2. In Rules, click + Check for condition and include target to segment.
  3. Enter an attributeoperator, and values for the segment. You can add multiple rules to your target group.
    Here is an example of a rule that serves true to all users whose email address ends with @harness.io.
    To write this rule, specify the attribute as email, the operator as ends with, and the user value as harness.io.
  4. Once you are done, click Save to apply the rule.

Option 3: Add Targets from Target Settings

You can use Target Settings to include or exclude Targets from the Target Group. Perform the following steps to include or exclude targets from the Target Settings:

  1. In Feature Flags, in Target Management, select Targets.
  2. In Target Settings, click the Target Groups tab.
  3. Click Add Target to Target Group.
  4. Select the Target Group from the list and click Add.
    The targets are added to the target groups.

Step: Add Target Group to a Flag

  1. Click on the target group to which you want to add a flag.
  2. Click Add to Flag.
  3. In Add Target Group to Flag, select the flag and variation.
  4. Click Add. The Flags using the selected target group are listed.

Next Steps


Please Provide Feedback