Deleting a batch run result for a Jenkins job

Why would you want to do it and how..

I must mention first there is a ton of value in using Jenkins,

It’s not only easier to run, use and share results, but also can give a historic view of the results

I have nightly builds and sometimes due to unavoidable circumstance there are some batch runs which really shouldn’t be in the history for that job (it’s a long story, so just humor me)

To keep your batch run history clear of any unnecessary ‘noise’ you might want to delete a specific job run result

Here’s how you do it:

  1. From Jenkins “configure global security” page, set ‘Anyone can do anything’ in the ‘Authorization’ section
  2. Run CMD with admin rights and ‘cd’ into Jenkins-cli.jar file location (e.g. C:\Program Files (x86)\Jenkins\war\WEB-INF)
  3. Confirm the batch run you want to delete (this is irreversible)
  4. Write the following command:
    1. java -jar jenkins-cli.jar -s       <Jenkins server>     delete-builds     <job name>              <build number to delete>
  5. Restore security settings

Tadaa!

P.S.

I know this was written very short hand, will write up a post on a few tips including this one.

#QsDaily #Automation #Jenkins