Similar to this question: https://stackoverflow.com/questions/33784488/how-can-i-delete-a-job-using-job-dsl-pluginscript-in-jenkins#=
The issue is if I add removeAction('DELETE')
to the DSL, the job will be deleted which is what I want, but I'd also like to run some cleanup code. Is there a way to query JobDSL, or get a delta of the new jobs being created vs what previously existed last run?
The context is, I am using JobDSL to create a pipeline job for each branch that exists in a GIT repository. When the branch is deleted, I want to remove the job and run some cleanup code.