| The suggested workaround will not work if your script uses 'checkout scm'.
{{java.lang.IllegalStateException: inappropriate context at org.jenkinsci.plugins.workflow.multibranch.SCMVar.getValue(SCMVar.java:75)}}
'checkout scm' is only allowed for CpsScmFlowDefinition type jobs, not the CpsFlowDefinition type job used by the workaround. In my case, I fully worked out a Pipeline script to build the master branch, then duped the job and modified it to trigger on patchset-created events in Gerrit. I suppose I'll go back to the original script and modify it to build its own scm object. I'll have to keep in mind that it could be invoked by either a ref-updated or patchset-created event, changing the parameters to the git scm class. It's a bit of a rabbit hole. |