Release process variables
You can create variables to use as input and output parameters within your release process actions.
Create process variables
A process variable is an entity used in the context of a specific process or template in place of a static field value. You can use variables in auto actions.
You can define one or more variables to parameterize your release process. This allows you to use process templates without having to manually adjust the input properties and gate criteria. For a sample flow using variables, see Release process flow.
Note: Creating and managing process variables requires the relevant permissions. By default, permissions are granted to the Release Manager and Admin roles.
To define a variable:
- In Release Management > Process Templates, select a template and select the Variables tab.
- Click + Variable, and define the following variable properties:
- Use a combination of letters and numbers.
- Do not include spaces or special characters. The only exception is the underscore (_).
- Non-Roman letters are acceptable.
-
When creating a template from a process, or when duplicating a process, only default values are copied.
-
if a variable was not defined with a specific value, then it takes the default value when the process moves into the In Progress phase.
-
A value can include a maximum of 255 characters.
Property | Details |
---|---|
Name |
A unique name that represents the purpose of the variable. For example, useful variables could be branch, build_num, version_num, and deployed_url. When defining a variable name, follow these guidelines: Note: Variables can be renamed at a later time. |
Type |
String (currently the only supported type). |
Value |
The value of the variable as generated by the last run. Run the action at least once to see the current values. |
Default value |
If relevant, provide a default value. For example, you can specify main as the default for a variable called branch. Consider the following: |
Description | A description of the variable. For example, outline its purpose or provide other meaningful information. |
Run a process with variables
You can run a process that is comprised of a series of auto actions, where later actions use values from previous ones. You do this by passing variables as parameters between the actions. For example, you can use the output property Build Number of a Run Jenkins Job auto action and store it in a variable. For a subsequent action, you can use the build number as an input parameter to notify users about the status of a specific build.
Note: Variables are only supported for auto actions, not manual actions.
You can use variables in string and memo text fields, such as message and comments, located within the Input properties section of your auto actions.
You can also use process fields as input variables. For example, If your process has a Version Name user-defined field, you can use it as an input value for a Send Email auto action. To see a list of the available process fields, type ${ in the input field.
To add variables to your input properties:
-
Define variables as described above.
- In your release process, select the Process Flow tab and select the auto action to which you want to assign the variables.
- In the auto action's Details tab, go to the Input properties section.
-
List fields. In list fields, choose a parameter. In the right column, type ${ to open a list of the available variables and fields. Select a variable.
The example below shows a variable selected in the Execution parameters section.
-
Text fields. In text fields, such as Comment or Message, type ${ (curly bracket) to open a list of the available variables. Select a variable. Include other text around the variables. For example, if you defined the variables team and build_num variables in your template, type the following in an email Message field:
Well done ${team}! Build ${build_num} succeeded
.In addition, you can add process field values to reference fields of other related entities. For details, see Advanced output processing.
Tip: After the auto action has been completed, open the History tab to view the input and output properties used during the action.
Advanced output processing
Certain auto actions, such as CI jobs, generate output properties. You can assign these properties to variables for use in subsequent actions. For example:
-
if you have an email auto action following a CI job action, you can add a message which includes the current Build Number and Build Status values.
-
A Document report action generates a URL, which you can share with your team.
-
A PulseUno action generates a build number, which you can include in emails.
This following procedure describes advanced output processing, where you use automatically generated output properties, such as build number and version, to set variable values.
To use output properties as variable values:
-
Define variables as described above. It is advisable to use names that reflect the output property, such as build_num, build_status, and version_number.
-
In your release process, select the Process Flow tab and select the auto action from which you want to use the output properties, such as a CI job.
- In the auto action's Details tab, go to the Output properties section. The output property values are generated during the run.
- In the Advanced output processing section, select a variable from the list.
-
In the Value field, type ${ to open a list of the available properties. Automatically generated properties have the following prefix: this.output_properties.
-
Version 24.3 and later: In text fields, you can add a dynamic parameter to display a related entity's reference field. Use the following syntax to obtain the process field value for the reference field:
${process.<entity_name>.<field_name>}
. For example, if you have a user-defined field titled target_milestone_udf, you can add the following to the Subject field of an email auto action:We are approaching the target milestone ${process.target_milestone_udf.name}
. -
Save the auto action.
-
In subsequent auto actions, use the variable that you assigned to the output property. For example, for a Send email auto action, you can type the following in the Message field:
Build Number ${Var1} finished with a ${Var2} status.
Execution flow with variables
This section describes a typical flow, using auto actions, quality gates, and variables in the release process flow.
The use of variables allows you to automatically connect the stages of your testing process with up-to-date and relevant data.
-
For details about creating and running variables, see Create process variables.
-
For details on how to add variables to your actions, see Run a process with variables.
Stage | Action | Input variables | Output variables |
---|---|---|---|
Run a nightly build |
Auto action: Nightly build |
|
|
Deploy the environment |
Auto action: Deploy QA env |
|
|
Run sanity tests |
Auto action: Sanity tests Quality gate: No failed runs for critical tests in latest nightly build. Criterion filters test runs by job name and build number. |
|
|
Run additional tests - Stage 1 |
Auto action: Run UFT One tests Quality gate: check that all tests were executed. |
|
|
Run additional tests - Stage 2 |
Auto action: Generate doc report with results of run, suing a template that shows last runs from last day, per job name. |
|
|
Send notifications |
Auto actions:
|
|
|
Run updates |
Manual actions:
|
See also: