How to build past commit

Jenkins setup:
Jenkins: 2.440.2
OS: Windows Server 2012 R2 - 6.3
Java: 11.0.13 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

Hello all!

Does someone have idea how to build past commits when working on multibranch pipeline project?

What I tried was modyfing Jenkinsfile so:

  • after default checkout from bitbucket plugin (which i cannot ommit, can I?) it forces cleanup and checkouts to specific commit hash
  • then it loads Jenkinsfile (from past commit) and ideally it would execute build further

Problem is we cannot call another pipeline from a top level pipeline. I could possibly use groovy scripts to call them from the top level pipeline but then i kinda lose the approach of rebuilding from the past commit (jenkinsfile can be change along the time).

I hope it’s clear enough what I’m searching for.


Or maybe I should somehow fake webhook action from bitbucket for the past commit to trigger the build?..