Create Release Variables
You can use variables to manage information that you don't know in advance or that may change. Unlike global variables, release variables can only be used in the template or release in which they are created. You can create a release variable using the release flow editor or the Variables screen.
Create a release variable in the release flow editor
To create a release variable, type its name in a task in the Release flow editor, using the ${ }
syntax.
Example: Typing ${name}
creates a variable called name
, which you can then edit on the Variables screen.
The variable's type depends on the type of the field where you created the variable.
Example: If you type ${name}
in a text field, name
will be of the type text and if you type ${name}
in a password field, name
will be of the type password.
Other properties, such as the variable's label and description, will be left blank. You can edit them on the Variables screen.
If you enter a password in the ${variable}
format, Release will treat it as a variable, so you cannot use this format for the text of the password itself.
Create a Release Variable on the Variables screen
You can also create Release variables using the Variables screen:
-
In a release or template, select Variables from the Show menu.
-
Click New variable. The Create Variable screen displays.
-
In the Variable name field, type a name for the variable.
-
In the Label field, enter a label for the variable. This will display next to the fields in which users can enter a value for the variable.
-
Select the variable type from the Type list:
-
Text: A string of letters or numbers
-
List box: A drop-down list of selectable values that can be reordered and can contain duplicates
-
Password: A password
-
Checkbox: A true or false Boolean value
-
Number: An integer
-
List: A list of values that can be reordered and can contain duplicates
-
Multi-select List box: A drop-down list to select the multiple values
-
Date: A value with formatted time and date
-
Key-value map: A set of keys and corresponding values
-
Set: A set of values that cannot be reordered and cannot contain duplicates
-
To prevent the display of passwords, password variables can only be used in password fields. Any other type of variable cannot be used in password fields unless the 'Allow passwords in all fields' is checked on the release properties tab. If selected, passwords can be used in any text field, and the value will be scrubbed from the task output.
- Certain variable types will open additional fields, such as Value provider type or Possible values. Enter the values here if needed.
- In the value field, enter the value for the variable. To add a value to a list or a set, type the value in the box and press ENTER.
- In the Description field, enter the description of the variable. This will display below the fields where users can enter a value for the variable.
- If the variable must have a value, select Required.
- To allow users to enter or change the variable's value when starting a release, select Show on Create Release form.
- Click Create to create the variable.
How required variables work
If a variable is required and you selected Show on Create Release form, the variable must have a value before the release can start. This can be the default value that you set for the variable in the template or a value that the user enters when starting the release.
Similarly for tasks, if a variable is required and it is used in a task, then it must have a value before the task can start. This can be the default value that you set for the variable in the template or release, or a value that the user enters before the task becomes active. If a required variable is missing a value when the task becomes active, the task is not started and remains in the needs input state until a user enters a value.
Edit a Release variable
To edit a variable in a template or a running release, select Variables from the Show menu, then click the desired variable.
You cannot change the variable's type.
If you change the variable's value, planned tasks that use that variable will reflect the new value. Completed, skipped, or failed tasks will reflect the old value, except in the case of user input tasks, which always show the variable's current value.
Delete or replace a Release variable
To delete or replace a variable in a template or a running release, select Variables from the Show menu, then click Delete/Replace next to the desired variable.
If the variable is not being used in the template or release, confirm that you want to delete it.
If the variable is still in use, you can choose how it will replace the variable wherever it appears in the template or release. You can replace the variable with:
- A static value
- A different variable (in
${ }
format) - A blank space
After Release replaces all occurrences of the variable, it deletes the variable.
How to use variable(s) inside a variable
You can use variables inside another variable. For more examples, see Variables in Release