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,560,231
Community Members
 
Community Events
185
Community Groups

Get PR Target Branch

Hi,

I want to get the branch's PR's target branch.

This variable `bamboo.repository.pr.targetBranch` gives ${bamboo.repository.pr.targetBranch}: bad substitution

 

 

2 answers

1 accepted

0 votes
Answer accepted
Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 02, 2020

This variable available only for plan branches which were created when PR opened at repository. Please be sure you have this option selected at Plan branch management screen Capture 2020-04-02 at 14.14.21.png

I don't have that option.

How did you get to that page.

Screen Shot 2020-04-04 at 3.17.09 pm.png

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 03, 2020

It's available if default repository of plan supports PR: Bitbucket Server or Cloud 

I use PR in Bitbucket Cloud. Is there a special button I need to click?

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 04, 2020

What type of repository configured at Bamboo? It should be Bitbucket Cloud repo, not regular Git repository

The repo was using git. I have not changed it to Bitbucket Cloud.

I still get the same error

`line 2: ${bamboo.repository.pr.targetBranch}: bad substitution`

Screen Shot 2020-04-04 at 7.56.42 pm.png

I can see the PR option at the Plan branch management screen 

I have selected it. Still same error

Alexey Chystoprudov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Apr 04, 2020

You're on good path. Once you have repo with Bitbucket Cloud type and enabled option to create plan branch when PR opened.

Next time Bamboo detects pull request at repo it will create plan branch, every build at this plan branch will have variables you mentioned.

PR detection occurs every 3 minutes

Now I have another problem. After I change the repo. It is not checking out the branch. It is only on master.

Sorry now it is working.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events