Executing code when a branch is removed in Jenkins' multi branch pipeline
<p>I have a Jenkins that uses <a href="https://jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/" rel="noreferrer">multi branch project</a>. That is, when a new branch is created to repository, Jenkins automatically will automatically create a new job for the branch, and remove that job when the branch is removed.</p>

<p>Now, I'd like to run some code when the branch is removed, to clear testing environments that were created when the branch was created. It there a way to do this?</p>