You need to add "bbb" as a parameter to the job. Jenkins will now only pass thru parameters that are defined in the job that you are passing them to.
On Wed, Aug 3, 2016 at 9:35 AM Nick Grealy <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/jenkinsci-dev/bd1e7ee7-666e-48a3-a68e-ecb972511b39%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAPiUgVfbXAU1F_aZ5D%3DtV%3DOnzVa%3DuTRZok-E5wffHVeDXwZKFg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
