I would like to know if there is an option to pass the value from a file to one of the Jenkins parameters. For eg : I have a property file called config.properties and I would like to pass the value of a field called projectName to a Jenkins parameter called Project. How can I do this ?Answer1:
Use <a href="https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin" rel="nofollow">Extended Choice Parameter Plugin</a> - it allows you to define a property file and and a key within the file to use. The plugin expects comma-separated values to allow the user to choose one but if there's only one value - it will be chosen by default.Answer2:
<ol><li>Add the Plugin Extended choice Parameter as stated by antweisis</li> <li>Need a Property files which means the file with the content in following format Eg: dates=21012,2013,2014,2015</li> <li>I have added the Image with how I have Configured the jobs as shown in the image bellow. </li> <li>To dynamically add the content to a property file create a script and run it as cron job or run the job that will populate the file first.</li> </ol>
<a href="https://i.stack.imgur.com/ndGOy.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/ndGOy.png" data-original="https://i.stack.imgur.com/ndGOy.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>
<strong>Delimiter</strong> = comma as we have comma separated the values
<strong>Propertyfile</strong> = path to the files
<strong>Propertykey</strong> = the key we have used for our example we have used dates
This will successfully create a drop down from the content of the files.