Last active
August 29, 2015 14:16
-
-
Save NicolasGeraud/a22f70fd6df3e870b11a to your computer and use it in GitHub Desktop.
JENKINS - remove string property
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.* | |
import hudson.plugins.git.* | |
changeBranche(Jenkins.instance.items) | |
def changeBranche(items) { | |
println items.size | |
for (item in items) { | |
if (item =~ "Feature*") { | |
print(item.name) | |
print('(' + item.properties.size()+')') | |
for (prop in item.properties) { | |
if (prop.value instanceof hudson.model.ParametersDefinitionProperty) { | |
for (definition in prop.value.getParameterDefinitions()) { | |
if (definition instanceof hudson.model.StringParameterDefinition && "BRANCH" == definition.name) { | |
print('=>') | |
item.removeProperty(prop.value) | |
} | |
} | |
} | |
} | |
println('(' + item.properties.size() + ')') | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment