Symbolic variables for Jenkins


Symbolic variables are special user-defined variables in one of the following formats:

  • ${variable}
  • ${p:variable}
  • #variable#

You can use symbolic variables to dynamically provide input for Jenkins projects.

Types of symbolic variables

Type

Description

Parameter-based variables

These variables are in ${variable} format.

BMC AMI DevOps replaces these variables with the default or user-defined value of the corresponding parameter.

Example

You create a string parameter, Job_ID, with a default value, MME12345. When you build the project, the value of the symbolic variable, ${Job_ID}, is either MME12345 (the default value of the Job_ID parameter) or the value that you enter.

To use parameter-based variables, you must select the This project is parameterized check box in the General tab when configuring the project.

Field-based variables

These variables are in ${variable} format.

BMC AMI DevOps replaces these variables with the value of the corresponding fields.

Example

The value of the symbolic variable, ${Job Card}, is the value of the field, Job Card.

Plug-in variables file-based variables

These variables are in #variable# format.

BMC AMI DevOps replaces these variables with the value of the corresponding variable in the plug-in variables file.

Example

The value of the symbolic variable, #acctno#, is the value of the variable, acctno, in the plug-in variables file.

Important

  • For symbolic variables in ${variable} format, parameter-based variables have priority over field-based variables of the same name.
  • BMC AMI DevOps searches for symbolic variable values in #variable# format only in the plug-in variables file.
  • The symbolic variables provided in the samples are not keywords. You can use any variable name in the plug-in variables file and subsequently in the project.
  • If required, you can add more symbolic values to your project.
  • You can delete symbolic variables from the project and hard-code values. However, we do not recommend this because it prevents you from dynamically providing values for your project.
  • (BMC.DB2.SPE2310)Variable names of all types must be unique.
  • (BMC.DB2.SPE2310)Do not use any field name as a variable name (for example, SSID).

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*