Variable substitution fails with NumberFormatException
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
If you are using a Bamboo variable to populate a script or function that expects a numerical value, but the Bamboo variable is not correctly referenced, the following will appear in the job log
Can't assign value '${variable}' to attribute <name>, reason: class java.lang.NumberFormatException with message 'For input string: "${variable}"
原因
Bamboo variables need to have bamboo
prepended to the variable name when passed to Tasks, for example
variable = ${bamboo.variable_name}
instead of
variable = ${variable_name}
If the identifier bamboo
is not added, Bamboo will read this as a string, and not substitute the variable.
ソリューション
Please ensure that the variable is correctly passed as ${b
amboo.variable_name}
.