-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
-
Declarative backlog
This is similar to both JENKINS-40574 and JENKINS-43911 (well, how JENKINS-43911 would behave from 1.2 onward - previously it was just that environment was evaluated after agent during execution) - parameters is evaluated at the beginning of the Declarative runtime, but agent is populated before that, at the very start of execution. So if params.FOO already exists when the build starts, then agent { label params.FOO }}} will work fine, but if it's a new parameter (like, say, on first build of a branch), {{params.FOO's value there will end up as null.
A workaround for now is to do label "${params.FOO ?: 'whatever-the-default-value-should-be'}", but I'll work on a better solution.
- links to