The groovy syntax generator is NOT working for sample step properties: Set Job Properties. I\'ve selected Discard old builds and then entered
For declarative pipeline you can add this:
options {
buildDiscarder(
logRotator(
// number of build logs to keep
numToKeepStr:'5',
// history to keep in days
daysToKeepStr: '15',
// artifacts are kept for days
artifactDaysToKeepStr: '15',
// number of builds have their artifacts kept
artifactNumToKeepStr: '5'
)
)
}