Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Run Yaml anchor based on your input

Hello Everyone,

Is it possible right now to call the yaml anchor based on the user Input given.

For example: Lets say we have to give input as 'A' i should call Build, if i give input as 'B' , we should cal\run Build, dockerimage.

This i tried by giving user-input but i am not able to run the yaml anchors.

let me know your thoughts.



1 answer

0 votes


At the moment it is possible to give user input in custom pipelines only, you can check our documentation here (search for the 'variables' keyword).

I'm afraid that it is not possible to do that with yaml anchors and non-custom pipelines yet.

I found the following feature request in our issue tracker:

I believe that this is what you are looking for? If so, I would suggest that add your vote in the feature request (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request.

Please feel free to let me know if you have any questions.

Kind regards,

@Theodora Boudale  No both either documentation here (search for the 'variables' keyword) and BCLOUD-1955 are not my goal.

consider taskA and taskB as yaml anchors i can call when we need based on condition,simple if loop i have given as a use case.

let say i have 2 methods


When the bitbucket pipeline ask userinput if i enter 'A' or 'B' or 'C' it should perform the respective task

if (userinput == 'A')
else if (userinput == 'B')
else (userinput == 'C')



Thank you for your input and for explaining your use case.

Bitbucket Pipelines is based on YAML, and I am not sure if YAML allows using anchors inside commands like in the example you gave.

I would suggest opening a feature request about this in our issue tracker (including your explanation and use case) for our development team to consider, if this is possible.

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

221 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you