The groovy syntax generator is NOT working for sample step properties: Set Job Properties. I\'ve selected Discard old builds and then entered
properties: Set Job Properties
Discard old builds
If you need a programmatic way (i.e. doing this from a function, rather than using options{} pipeline syntax):
options{}
def someFunction() { ... properties([ buildDiscarder(logRotator(numToKeepStr: '5')) ]) }