Hi all,
This should be a simple question to answer...
Before Jenkins 2.X, I used to be able to execute a Job programatically with
the following code:
import jenkins.model.*;
import hudson.model.*;
// kick off a job...
FreeStyleProject job = Jenkins.getInstance().getJob('QuickTest');
job.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(Arrays.asList(
new StringParameterValue('aaa', 'zzz'), // exists in job's defined
parameters
new StringParameterValue('bbb', 'yyy') // doesn't exist in job's
defined parameters
)));
This would execute a new instance of a job, with two parameters - *aaa=zzz*
and *bbb=yyy*. Perfect.
Now, post Jenkins 2.X, I get the same behaviour, EXCEPT the *bbb* parameter
does not get injected (i.e. only defined parameters are included in the
job).
- How do I get *bbb* injected as (preferably) a build parameter (or
failing that, an environment variable)?
Kind regards,
Nick
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/bd1e7ee7-666e-48a3-a68e-ecb972511b39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.