Defining Target Groups

3 minute read

Target groups let you define groups of users based on user properties or device attributes. CloudBees Feature Management includes built-in targeting using the format of rox.<attribute name>.

  • The left column shows all target groups defined in the system and the last update time for each target group.

  • After selecting a target group, you can see the target group definition rules, edit the target group, and see on which environment and flags it is being used.

Target Groups Overview

Creating and modifying a target group, and adding a target group to a flag configuration.

Watch the video

Create a new Target Group

  • Go to the Target Groups tab from the left navigation menu.

  • Click on the New Target Group button on the top right side.

  • Give the Target Group a Name and a Description, also select the attribute on which you would like to segment via the drop-down menu.

  • Select the operator for the relevant drop-down menu.

  • Please note each attribute (depending on its type - String, Int, etc) would have different operators respectively.

  • Add the value to the input field.

Table 1. Built-in attributes
Attribute NameNotes


Two letter language code, e.g., "en," "es," or "fr"


OS name, e.g., "iOS" or "Android"


Screen height in pixels


Screen width in pixels

Editing a Target Group

  • Click on the Target Group you would like to edit.

  • Update the target group accordingly and click on the Update Group or Reset respectively.

  • If a target group is not being used, it can be deleted; click on the Delete button on the lower left corner.

  • When a target group is being used by feature flags, you can click on the environment name below the target group definition to see which feature flags are usibg this target group.

Edit a Target Group

Editing a live Production Target Group

You can still edit a Target Group even if it’s already being used in a running feature flag. Keep in mind you are changing the Production Environment

Custom Properties can be used to define segments of users. Once a custom property has been created, you can use it when creating target groups:

Custom Properties in the Conditions Pulldown


Please note the following:

  1. Custom properties can be static or defined in code using CloudBees Feature Management custom computed properties.

  2. In the client side SDKs, if the value of a custom property changes while the app is running—for example, after a user logs in you may need to use Rox.unfreeze(), (read more on flag update flow - Flag update flow).

Regex Syntax

You can run regex matching for custom properties from type String. Imagine the following example Target Group:


It is easiest to describe the underlying code behind the scene running on the SDK in the following scenario:

function regexMatch(str, pattern) {
    var regex = new RegExp(pattern, "");
    var match = regex.exec(str);
    return match ? true : false;
bool regexMatch(String str, String pattern){
   RegexOptions options = 0;
   Match match = Regex.Match(str, pattern, options);
   return match.Success;
boolean regexMatch(String str, String pattern){
   int options = 0;
   Pattern r = Pattern.compile(pattern, options);
   Matcher m = r.matcher(str);
   return m.find()
import (
boolean regexMatch(String str, String pattern){
  matched, _ := regexp.MatchString(pattern, str)
  return matched;
# In the above Example
#    str is the email property value
#    pattern is "@cloudbees\.com$"
matched = !, 0).match(src).nil?
import re

# In the above Example
#    str is the email property value
#    pattern is "@cloudbees\.com$", src, 0)
preg_match(pattern, src);

You can also check out part of our testing suite to understand the examples:

expect(parser.evaluateExpression('match("111", "222"')).toEqual(false);
expect(parser.evaluateExpression('match("22222", ".*")')).toEqual(true);
expect(parser.evaluateExpression('match("22222", "^2*$")')).toEqual(true);
expect(parser.evaluateExpression('match("[email protected]", ".*(com|ca)")')).toEqual(true);
expect(parser.evaluateExpression('match("[email protected]", ".*car\\.com$")')).toEqual(true);
expect(parser.evaluateExpression('match("US", ".*IL|US")')).toEqual(true);
expect(parser.evaluateExpression('match("US", "IL|US")')).toEqual(true);
expect(parser.evaluateExpression('match("US", "(IL|US)")')).toEqual(true);