Skip to content

Instantly share code, notes, and snippets.

@bbrks
Created August 17, 2022 12:34
Show Gist options
  • Save bbrks/1e29f3c9554d998ac25c06d1030a3439 to your computer and use it in GitHub Desktop.
Save bbrks/1e29f3c9554d998ac25c06d1030a3439 to your computer and use it in GitHub Desktop.
Jenkins script for each job's build update description with parameters
Jenkins.instance.getAllItems(Job.class).each{
if (it.name == "SyncGateway-Integration") {
it.getBuilds().each{
println 'old description: '+it.getDescription()
if (it.getEnvironment().get('TIMEOUT') != null) {
it.setDescription("timeout: ${SG_COMMIT} - ${BUILD_USER}")
} else {
it.setDescription("${SG_COMMIT} - ${BUILD_USER}")
}
println 'new description: '+it.getDescription()
}
}
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment