Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Pipeline Variables are now supported in .yaml Templating

Variables can be templated into your bitbucket-pipelines.yaml file via a simple, standardized templating syntax. Currently, this supports system variables and user variables (such as repository and workspace variables). For more details, see the Variables and secrets | Bitbucket Cloud | Atlassian Support. Custom pipeline variables are not supported.

We’ve now added custom pipeline variables to the existing set of supported variables, giving you more flexibility to specify values on a per‑run, per‑pipeline basis. You can template these variables in your YAML file at configuration time.

How it works:

Templating variables in your .yaml file uses a simple, standardized syntax ${{MY_VARIABLE_KEY}}.

  1. Wrap the variable key in your .yaml with ${{ }} tags; the system handles the rest.
  2. In the Run pipeline dialog, you can provide values for these variables.
  3. The system then templates the values of these variables.

Read more information about this here: Variables and secrets help document.

8 comments

Remco Timmerman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 6, 2026

We tried this out in different ways, but it does not seem to work. Can you give a more detailed example of how this would work? We would like to use it for the ability to set a custom runner tag and a deployment environment. When we use a variable that is defined in the repository variables it does work

Asher Pix
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 16, 2026

This does not seem to work, any update on this?

Edmund Munday
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 16, 2026

@Asher Pix & @Asher Pix - we're investigating this now, apologies for the delay.

Sejal Maheshwari
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2026

@Remco Timmerman @Asher Pix Hey, there was an issue on our end. We've fixed it. Can you try once now?

Asher Pix
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2026

@Sejal Maheshwari Works, thanks!

Yas_Bravo
February 17, 2026

It works when the pipeline gets manually triggered but it fails with the sheduled pipelines with error

The environment '${{ENV}}' in your bitbucket-pipelines.yml doesn’t match any environment defined in your settings. Either update your yml, or your settings, to use the same name.

Sejal Maheshwari
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2026

@Yas_Bravo You will need to provide the value of the ENV variable that matches your environment in the settings. How are you providing the value of this variable in the scheduled pipeline?

Yas_Bravo
February 24, 2026
@Sejal Maheshwari This is an example of how its been used, it has no issues when triggered manually , so we confirm it works as intended by leaving to use the default or selecting another env , but it does not work when it's triggered from a schedule pipeline. For the looks of it the yml is getting parsed and the ${{ENV}} its interpreted as a string and not as a variable so it never uses the default.

dev-variables
: &dev-variables-list
 - name: ENV
   description: "Deployment environment"
   default: "dev1"
   allowed-values:
    - "dev1"
    - "dev2"
    - "dev3"
    - "dev4"
....

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events