Last active
September 8, 2016 08:33
-
-
Save Larusso/7550775c5e932eb41619fe2242f26b16 to your computer and use it in GitHub Desktop.
Jenkins script that list all parameterized jobs with given parameter.
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
import hudson.model.* | |
parameter_name = "DEVELOPER_DIR" | |
allItems = Hudson.instance.items | |
allItems.each { job -> | |
prop = job.getProperty(ParametersDefinitionProperty.class) | |
if(prop != null) { | |
allDefinitions = prop.getParameterDefinitions() | |
filteredDefinitions = allDefinitions.findAll {definition -> definition.name != parameter_name} | |
appEnvDefinition = prop.getParameterDefinition(parameter_name) | |
if(appEnvDefinition) | |
{ | |
println job.name | |
} | |
} | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment