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

Choosing variable value for parametrized plan from predefined list of choices?

I have many small packages, which are being worked on, and built individually, using basically the same pipeline (only the package name differs).
So i guess i need to use parametrized plan, to allow the user to specify name of the package before running it.
Is there any way of extending the Bamboo UI, so the variable value with package name could be chosen from a list of values?
The problem is, there are approx. 50 of these packages in every project/branch, they are being updated relatively often, built on demand, and the idea of a user typing the value every time... it's too error prone and unfriendly.

From what i seen so far, Bamboo lacks this feature (define list of choices for variable value), but could it be solved via some kind of plugin?

2 answers

1 accepted

0 votes
Answer accepted

Why not use jquery to change the behavior of the Custom build dialog? You could make particular variables madatory by intercepting the click on the Run button or have predefined values (even change a text input to a dropdown) for specific variables by injecting the javascript in using a Web Resource Bamboo plugin.

Thank you, that would also be a way how to do it.
Nevertheless, because in this case i need to change just one variable, i decided to alter templates displayBuildPlansList.ftl, displayWideBuildPlansList.ftl, and menus.ftl, allowing me to make the drop down box accessible right away (depending on whether the plan uses that special variable), and select values with just one click (no need to even open that parametrized build form).

I wrote a web panel module plugin, which ended up as a dead end, because of the rather limited option where it can be actually placed.

But while i was working on the plugin, i discovered i can change the original templates - had no idea i could do that!
So i made changes to the "displayWideBuildPlansList.ftl" template, but i am unable to make it work with the AJAX request.
I can inject the variable name/value into the request URL, the plan is being run, but the value is not overriden - aparently, either the AJAX request isn't written to account for plan variables, or i am using wrong variable name.

So now my question is:
What is the correct way to pass the plan variable/value via the standard AJAX request ?
Is it even possible?

Suggest an answer

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

Unable to add or edit Bitbucket Cloud repository in Bamboo

On 31 May, a GDPR-related change went live in the Bitbucket Cloud API that resulted in users not being able to create or edit Bitbucket Cloud Linked repositories in Bamboo. This API update removed t...

299 views 2 6
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