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,556,745
Community Members
 
Community Events
184
Community Groups

shortPlanName changed in 6.10.4 release

we have been using plan branch builds for some time and used the shortPlanName as a nice variable that contained the branch label, to construct compound filenames.

in the latest release this variable has changed to not include the branch name, but only contain the plan name?

 

is this a bug or feature :). ive got around this by doing

 

oldShortPlanName=${bamboo_planName##* }

 

its a bit of a pain, the previous implementation IMHO is better

1 answer

1 accepted

0 votes
Answer accepted
Guilherme Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 16, 2020

Hello @Ian Underhill ,

The previous behavior was not the correct one and was a BUG being tracked: shortPlanName contains branch name for plan branches 

As this was resolved on Bamboo 6.10.2, this behavior has changed since.

Currently, Bamboo doesn't have a variable that retrieves the branch name; however, there's an open feature request for this: Variable to get plan branch name.

Also, we can see that Daniel Santos suggested a workaround for Linux script tasks, which uses the planName variable:

bamboo_planBranchName = ${bamboo_planName##* - }

I hope it helps. 

Hi

How do I implement the workaround? Where do I set this variable?

You can use this type of variable in a script that is run on the remote agent.

So add a script step to your task. this is obviously a remote agent running Unix with bash

 

#!/bin/bash

 

oldShortPlanName=${bamboo_planName##* }

echo ${oldShortPlanName}

Like Guilherme Luz likes this

Thanks I figured it out. For those interested.

I used the shortname to tag docker images, now Im using bamboo_planRepository_1_branch which sometimes has a / in the branch name which is not compatible with docker tags to resolve I replace / with _

#/bin/bash

docker build -t APPNAME:${bamboo_planRepository_1_branch//\//_}-{BUILDNUM}

@Ian Underhill  thank you really saved me here.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events