I am trying to use Bamboo build variables in a Task plugin (e.g. bamboo.jira.version and similar). Using taskContext.getBuildContext().getVariableContext()
only seems to retrieve custom build variables, and not the ones that are built into bamboo.
There doesn't appear to be much documentation on this at all in the plugin SDK documentation and there are no answers on Atlassian Answers that appear to work or that refer to API calls that are still in the SDK.
How can I accomplish this?
You can inject an instance of CustomVariableContext into your task and then use the following to get the build variables:
Map<String, String> buildVariables = customVariableContext.getVariables(taskContext.getCommonContext());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With