Hi,

the syntax is something like

ArrayList<ParameterValue> yourparamaters=new ArrayList<ParameterValue>();
yourparamaters.add(new hudson.model.StringParameterValue('PARAM','123'));

build  job: 'yourJobNameToBuild', parameters: yourparamaters


you can also shorthand this if you don;t need to re-use the same parameters

build  job: 'yourJobNameToBuild', parameters: [new hudson.model.
StringParameterValue('PARAM1','123'), new hudson.model.StringParameterValue(
'PARAM2','345')]


However - I would caution against using the workflow to trigger other jobs 
if you can - It's ideal is to self contain the workflow and steps in a 
single place so you don't have configuration sprawl (the workflow and all 
the configuration of it is defined in one single place).

/James


On Monday, 24 November 2014 08:10:08 UTC, excessgr wrote:
>
> I'm a bit confused as to how to pass parameters to triggered jobs. 
> The snippet generator says I can pass a list of ParameterValues, but I'm 
> really unfamiliar with the internals of jenkins so I'm not sure how I can 
> pass this list.
>
> I assume this is what the list should look like:
> ArrayList<ParameterValue> parameters=new ArrayList<ParameterValue>();
> parameters.add(new hudson.model.StringParameterValue('PARAM','123'));
>
>
> However I'm checking the constructor of the build step and there is no 
> such parameter to pass through. 
> How do I use the setter before the build is executed?
>
> Thanks.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" 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-users/097cb936-d309-4c4e-9877-a2969a506ca8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to