The groovy syntax generator is NOT working for sample step properties: Set Job Properties
. I\'ve selected Discard old builds
and then entered
You can use the properties
method which, nested within the BuildDiscarderProperty
eventually has the key you want to set. I still don't have a solid way to look up the correct syntax of each key. After much guessing and checking:
properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]);
Note that this snippet is for scripted syntax.