Last active
October 16, 2020 21:41
-
-
Save akostadinov/b80c8758a7f79ec8d9aaf199e27f1347 to your computer and use it in GitHub Desktop.
Jenkins Job deafault value of parameter of a job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job = Jenkins.getInstance().getItem("Flexy-install") | |
println job.getProperty(ParametersDefinitionProperty.class)?.getParameterDefinition("REPOSITORIES")?.getDefaultParameterValue() | |
/* | |
License: https://en.wikipedia.org/wiki/WTFPL | |
Some readers: | |
https://support.cloudbees.com/hc/en-us/articles/226941767-Groovy-to-list-all-jobs | |
https://medium.com/@mukeshsingal/update-default-values-of-jenkins-job-parameters-416de5ff9f96 | |
https://javadoc.jenkins.io/hudson/model/Job.html | |
https://javadoc.jenkins-ci.org/hudson/model/ParametersDefinitionProperty.html | |
https://javadoc.jenkins-ci.org/hudson/model/ParameterDefinition.html | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment