So to answer my own question, here is what worked for me:
def corejob = build job: 'MyJob', parameters: buildparams
def item = hudson.model.Hudson.instance.getItem('MyJob')
def changelist =
item.lastBuild.getEnvironment(null).get('P4_CHANGELIST')
buildparams.add(new
hudson.model.StringParameterValue('P4_CHANGELIST',changelist));
and so on. A bit cumbersome but it appears to work. The documentation this
is really poor IMO.
andy
On Wednesday, 4 February 2015 15:44:56 UTC, Andy Piper wrote:
>
> In particular I have a job that uses p4 and therefore sets the variable
> P4_CHANGELIST which I can pass to downstream jobs. How do I access this
> parameter from a job in order to pass it on when using the workflow plugin?
>
> I want something like:
>
> def thejob = build('myjob');
> build job: 'nextjob: parameters: thejob.P4_CHANGELIST
>
> or something. I'm sure it's simple but I cannot find any documentation
> that gives me any clues.
>
> Thanks
>
> andy
>
--
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/093fffe6-57ac-4371-b91e-03d92781f9dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.