Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,110
Community Members
 
Community Events
184
Community Groups

bamboo requirement capability variable with pipe | operator doesn't work in Bamboo YAML specs

Edited

We have a requirements capability variable

var = org1|org2|org3

when used this variable in bamboo yaml specs, it gets treated as string text and not as it gets processed from UI config.

Please help how this can be handled.

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 24, 2023

Hello @ananda3

Bamboo YAML Specs will match a Regex under Requirements.

For example, I want my plan to accept my_requirement as either org1, org2 or org3:

---
version: 2
plan:
project-key: ABC
key: GHI
name: GHI
stages:
- Default Stage:
manual: false
final: false
jobs:
- Default Job
Default Job:
key: JOB1
tasks:
- checkout:
force-clean-build: 'false'
description: Checkout Default Repository
artifact-subscriptions: []
requirements:
- my_requirement: ^(org1|org2|org3)$
...

Please check your YAML code for a valid regular expression.

Thank you,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

@Eduardo Alvarenga this way I agree that my_requirement will be accepted as it is hardcoded in specs. However, my use case is that I want it to be configured from outside of the bamboo specs and dynamically bind with in the specs via project variable.

As mentioned, we have Requirements required capability defined with as a variable (e.g. my_requirement). Now, the condition that is put in place in UI config is

"my_requirement matches org1|org2|org3"

I want to map my requirement in bamboo specs as following:

project_org_variable = org1|org2|org3

requirements:
- my_requirement: ${bamboo_project_org_variable}

 But, this doesn't work. Our use case is that if org1 is down then we can just update the project variable to org2|org3 and there is no need to update bamboo specs for this.

If I follow above approach, it comes as below in the spec file

requirements:
- my_requirement: 'org1|org2|org3'

I need a way to get rid of these quotes.

Like Eduardo Alvarenga likes this
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2023

Hello @ananda3

Adding variables to the Agent can Capabilities requirement fields is currently not supported in Bamboo.

We have a feature request you can vote on and follow to be notified of any changes in the future.

Make sure you add a comment with your specific business case so the developers can consider it to expedite the feature implementation.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events