Build History Manager1.2.0Minimum Jenkins requirement: 2.138.4ID: build-history-manager

Installs: 210
Last released:20 days ago
Damian Szczepanik

Travis Status Appveyor status Shippable Status

Coverage Status Codebeat badge Codacy badge Vulnerabilities CII Best Practices

Installs Version

Jenkins plugin that allows to build complex rules to define which builds should be removed from the history and which preserved.


The motivation of creating this plugin is to deliver powerful tool that allows to define rules that are built from two types of objects:


Following configuration has two rules. First one makes sure that the newest build with failure status is not deleted. Second deletes all builds which are not success. In other words it keeps the most recent broken build and all stables.

pipeline {
    agent any

    options {
                conditions: [
                    BuildResult(matchFailure: true)
                matchAtMost: 1,
                continueAfterMatch: false
                conditions: [
                    BuildResult(matchAborted: true, matchFailure: true, matchUnstable: true)
                actions: [DeleteBuild()]

    stages {
        stage('Demo') {
            steps {
                echo "Hello!"


Following simple configuration allows to save last 5 builds, rest will be deleted: Condition filters out builds which should be performed by actions. So plugin can filter builds by:


Actions defines how the build filtered by above condition) should be modified. Plugin can:

  • mark the build to be kept forever
  • delete the build
  • delete artifacts


Read Wiki for more details. Check also information how to avoid problems when creating rules.

There is possibility to build complex rules. Each rule can define more than single condition and action. Plugin starts as BuildDiscarder class. Core method that is responsible for processing conditions and actions are stored in Rule.perform() method.


feature overview page

Use cases

Using conditions and actions there is easy to realize following scenarios:

  • Delete builds which are unstable or aborted if they are not valuable from the history/audit point of view.
  • Keep only last build per result. So the history contain the most recent builds for result aborted, unstable, failure and success.
  • Keep builds only from master branch if the project builds all branches including feature branches
  • Remove builds which have build number lower than given value to easily drop all old builds at once.

Code quality

Once you developed your new feature or improvement you should test it by providing several unit or integration tests.

Release notes

Check release notes for changelog details.


If you find the issue you can send pull request to fix it or file the bug. The same about missing Action or Condition Remember about:

  • doing tests on your local Jenkins instance
  • adding new unit tests according to given -> when -> then approach.
  • remember about integration tests and wiki update
ArchivesGet past versions
This plugin has no labels