-
Improvement
-
Resolution: Duplicate
-
Major
-
None
I would like to reference other parameters for string parameter. Something like:
MY_STR_VAR = xyz-${BUILD_NUMBER}
This works sometimes but not for all cases. Consider the following example:
COUNT = 3
PREFIX = xyz
NAME = ${PREFIX}-${COUNT}
When I try to print these parameters using the echo cmd, I find that the value of $NAME is "${PREFIX}-3".
After some thought, I think I know what is happening. jenkins is internally sorting the parameter names and then substituting values of referenced parameters. Since $NAME is evaluated second, it doesn't have the value of $PREFIX and hence cannot substitute its value.
It would be nice if jenkins would evaluate the parameters in the original order they were specified by the user. This is intuitive and very useful behavior. Users can specify the parameters in the right order and reference them if they have already been defined.
PS: Note that parametrized-trigger plugin already supports such a feature.
- is related to
-
JENKINS-11741 Environmental variables are evaluated in alphabetical order
-
- Resolved
-