Bad Substitution in nested variables
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
The following appears in the atlassian-bamboo.log
:
1
2
DD-MMM-YYYY hh:ii:ss
<bamboo-install>/temp/MP-HP-JOB1-2-ScriptBuildTask-2305625869057087111.sh: line 2: ${bamboo.Integer}: bad substitution
Cause
If you create a variable named as myInteger and assign 123 to it, by calling the variable myInteger (e.g: ${bamboo.myInteger}) the same will return within the value 123 as expected.
On the other hand, if you create a second variable named as mySecond and assign ${bamboo.myInteger} to it, by calling the variable mySecond (e.g.: ${bamboo.mySecond}) the same will throw an exception.
Resolution
This will happen because Bamboo variables does not provide double dereferencing.
We have a improvement request to provide this functionality in future releases:
Was this helpful?