Skip to content

Instantly share code, notes, and snippets.

@NicolasGeraud
Last active August 29, 2015 14:16
Show Gist options
  • Save NicolasGeraud/a22f70fd6df3e870b11a to your computer and use it in GitHub Desktop.
Save NicolasGeraud/a22f70fd6df3e870b11a to your computer and use it in GitHub Desktop.
JENKINS - remove string property
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