Variables in Digital.ai Release
Digital.ai Release uses variables to make your release templates more flexible and reusable. Variables allow you to parameterize your release processes, making it easier to manage dynamic content and configuration across different environments and scenarios.
Understanding Variables
When creating release templates, you'll create tasks that contain information that varies based on the release. For example, you can have one generic release template used for releasing several applications, where each release requires different application names.
You can use variables to manage information that:
- Is not known when designing a template, such as the name of the application
- Is used in several places in the release, such as the name of the application, which you can use in task descriptions and email notifications
- May change during the release, such as the version number of the release that is being pushed to production
Variables are identified by the ${ }
syntax. Release supports several types of variables. Examples: text, password, number, and list.
Variable Scope
In Digital.ai Release, variables can be created with different scopes to control their visibility and usage:
- Release variables can only be used in a specific template or release.
- Global variables can be used in all templates and releases.
- Folder variables can be used in all templates and releases inside a specific folder.
How to Create a Global Variable
Global variables provide consistent values across all templates and releases. Here's how to create them:
If you have the Edit Global Variables permission, you can create global variables in Settings > Global variables. For information about creating, editing, and deleting global variables, see Configure global variables.
The properties must be configured correctly to ensure proper variable behavior across the system.
How to Create a Release Variable
If you have the Edit Template or Edit Release permission on a template or a release, respectively, you can create a release variable by:
- Typing the variable name in a field in the release flow editor using the
${ }
syntax - Using the Variables screen
For more information about creating, editing, and deleting release variables, see Create release variables.
How to Create a Folder Variable
If you have the Edit folder variables permission on a folder, you can create folder variables in Overview > Folders of the navigation pane, select a folder, then select Variables (available in Release 8.6.0 and later).
For more information about creating, editing, and deleting folder variables, see Configure folder variables.
Skip Nested Variable Interpolation for Text Variable Types
You can skip interpolation of values and prevent Digital.ai Release from creating variables out of it for Text type variables.
Configure this setting by selecting the Variables > Create variable > Prevent variable interpolation check box. This check box is enabled only when you select Text from the Type drop-down list.
Note: It is applicable only for Text type variables. It can be set at Release, Folder, and global levels.
View String Type Variable Values in String Type Fields
Text type fields, by default, fetch and show the values of the String type variables added to them. Text type fields show the variable's name in case the variable has no values assigned to it.
Here's a Text type field—${title}—for example, with a value assigned to it.
Here's how the Release Title text field shows the value of the String type variable when you add the variable to the Release Title field.
Where Variables Can Be Used
You can use variables in most fields in Release releases. Examples: in the titles of phases and tasks, in descriptions of phases, tasks, and releases, and in conditions and scripts.
While global, folder and release variables can be used in input properties of tasks, only release variables can be used in the output properties of such tasks.
You can create release variables that must be filled in before a release or task can start. For more information, see Create release variables.
You can change the values of variables in an active release, although doing so will only affect tasks that are in a planned state.
Examples of Using Variables Inside Another Variable
In Release version 8.5 and later, you can use variables inside another variable. This does not apply to password types and index/key access of complex types (ex, ${list[2]} or ${map['key1']})
Example 1: String Variables Inside String Type Variable
${host} = localhost
${port} = 5516
${url} = http://${host}:${port}/
Example 2: String Variables Inside List Type Variable
key: 'list',
value: ['${var1}', '${var2}'],
Example 3: String Variables Inside Set Type Variable
key: 'set',
value: ['${var1}', '${var2}'],
Example 4: String Variables Inside Map Type Variable
key: 'stringMap',
value: {'key1': '${var1}', 'key2': '${var2}'},
Using a List Variable as a Value in the List Box Variable Types
You can create a List variable and use it as a possible value for a List box variable.
-
Create a global variable or a release variable with the type List.
-
When you create a new variable and select the type List box, click the button next to the Possible values to switch between a list of normal values or a variable of type List.
-
Select the second option and choose a List type variable.
-
Click Save.
You can use the List box variable in templates, releases, or tasks allowing users to select the values from predefined List variable.
Using Lists of Applications or Environments in the List Box Variable Types
You can choose a list of Applications or Environments to be used as possible values for a List box variable.
Please specify the run-as user and password on the template properties as those credentials will be used to retrieve the available Applications and Environments.
Applications and environments will only be retrieved during release creation and User Input tasks. The list of values will be empty in other scenarios, such as when manually changing variable values.