I have a pipeline with some boolean parameters. I'd like to add the quietPeriod as described in the docs but I'm struggling to get the syntax right. I tried:
properties([
parameters :[
booleanParam(name: 'foo', defaultValue: false, description: 'bar')
],
quietPeriod: 10
])
But that yields a
java.lang.UnsupportedOperationException: must specify $class with an implementation of interface java.util.List.
Does anyone know how to add this parameter correctly?
From this Jenkins ticket in JIRA it seems like the feature is only available by default when the Declarative Pipeline syntax is used.
As a workaround I found that doing
currentBuild.rawBuild.getParent().setQuietPeriod(210)
works like a charm. You can put it right after setting the properties, like this:
properties([
parameters :[
booleanParam(name: 'foo', defaultValue: false, description: 'bar')
]
])
currentBuild.rawBuild.getParent().setQuietPeriod(210)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With