Search code examples
jenkinsparameter-passingpipelinejenkins-workflowparameterized

Jenkins - Using build parameters passed during Trigger of a Job


I have a pipeline in Jenkins, where one project sends parameter to the next one. The trigger is set during the Build step and is the last step in the Build process. I have checked the "For each property file, invoke a build" button, where the properties files to be read are in the work space of the current project.

On build, I can see that the Downstream project following the current one, is given the properties of the property file. But when I try accessing them, it just takes the name of the variable and not the value. This means that I am not able to access the parameters in the property file. Can you tell me how will I be able to access the parameters that were passed during trigger from the property file? I have tried all ways, but I can't seem to access them.

Image of Parametrized Trigger--

enter image description here


Solution

  • I solved the issue: in order to use the parameters sent during the trigger, we need to declare them in the triggered project. They should be kept empty. Once we do that, they will take the values sent across by the previous project.