0
votes

I have two Jenkins environment both in different machines and both are different jobs.

A job in Jenkins 1 triggers a remote job in Jenkins 2 using Parameterized Remote Trigger plugin.

Is there a way in which i can add the build parameters from the job in Jenkins 1 to the job in Jenkins 2 ?

1

1 Answers

0
votes

You can trigger the remote job by adding an 'execute shell' step wherein you call remote jenkins job API.

E.g.: curl -X POST JENKINS_URL/job/JOB_NAME/build \ --data token=TOKEN \ --data-urlencode json='{"parameter": [{"name":"id", "value":"123"}, {"name":"verbosity", "value":"high"}]}' .

See here https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API (paragraph 'Submitting jobs' > 'Jobs with parameters')