Define chain and global variables

Add chain and global variables so that you can reference them in chain steps when you need to reuse specific values.

For details about variables and how to reference them in chains, see Use variables in chains.

Add chain variables

Define variables on a chain to reuse the same values in the chain's steps.

To add a variable to a chain:

  1. From the spaces list at the top right, select a space.
  2. On the Products page, select the product or Git repository where the chain is located.
  3. In the sidebar, select Chains.
  4. In the chain list, click a chain's name to open the chain.
  5. On the chain page, click Edit.
  6. In the chain's editing window, select the Variables tab, and click Add Variable .
  7. Enter a variable name and value pair, for example:

    Name: MAVEN

    Value: M2_HOME

    You cannot add variables with duplicate or empty names.

  8. (Optional) To make the variable private, select the Private option. The values of private variables are displayed obscured in the user interface.
  9. Click Save.

Back to top

Add global chain variables

Define global variables to reuse the same values across multiple chains and steps.

Note: Administrator permissions required.

To add a global variable:

  1. Navigate to Administration > Global Chain Variables.
  2. On the Global Chain Variables page, click Add variable .
  3. Enter a variable name and value, for example:

    Name: JENKINS_URL

    Value: http://host:8080/jenkins

    You cannot add variables with duplicate or empty names.

  4. (Optional) To make the variable private, select the Private option. The values of private variables are displayed obscured in the user interface.
  5. Click Save.

Back to top

See also: