Variables
When creating release templates, you will create tasks that contain information that varies based on the release. For example, you can have one generic release template that is used for the release process of several applications. Different releases based on this template will require 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 Release, you can create variables with different scopes:
- 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
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.
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 varaible 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 (example, ${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}'},