I encounter a problem in Jenkins that is related to build History. The history is constantly resetted to build number 1 even if I don't have any build discarder option added on my Jenkinsfile. If i'm adding discarding options, the build still resets to build number 1 after couple of builds.

       options {
            artifactDaysToKeepStr: '30',
            artifactNumToKeepStr: '30',
            daysToKeepStr: '30',
            numToKeepStr: '30'

This is the syntax I'm using, but it does not work. Is the any other method of persisting build history in Jenkins declarative pipelines? Other than using Build discarder plugin?

Thank you,


  • It might be defined in the job configuration, depending what type of job you're using. – plmaheu May 14 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.