Forums

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

How to make Bamboo plan dynamically detect the triggering repository?

Muhammad Alnaghi
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!
May 27, 2025

A single Bamboo plan is configured to build and deploy multiple applications.

Multiple Bitbucket repositories are linked to this Bamboo plan.

The plan is set to trigger automatically using the "Bitbucket Server repository triggered" trigger on any commit to any of the linked repositories.

The Bamboo job includes an SSH Task that:

Clones the repository source code

Creates a zipped package of the application

Uploads the zip as a build artifact

Previously, a static variable (bamboo.ProxyName) was used to specify the application name — this worked only when the plan was targeting a single application from a fixed repository.

This static variable has been removed, and the script now tries to use ${bamboo.planRepository} instead.

The problem is that ${bamboo.planRepository} and similar variables always reference the default repository, not necessarily the one that triggered the build.

Since multiple repositories are now linked to the plan, this causes:

The wrong repository to be cloned

The wrong application to be built or deployed

A solution is needed to dynamically identify which repository actually triggered the plan so that the correct source code is processed in the script.
thanks

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events