Conditional OR for multiple Jenkins parameters
<p>I'm looking for a way of handling multiple parameters within a Jenkins job.</p>

<p>My build can either be triggered by a push to Gitlab or manually.</p>

<p>Gitlab passes <code>${gitlabSourceBranch}</code> as a parameter containing the branch it has received a push for. My <em>branches to build</em> setting is currently set to <code>origin/${gitlabSourceBranch}</code>. Works like a charm when pushing to Gitlab.</p>

<p>Unfortunately, and naturally, when triggering a manual build, it fails:</p>

<pre><code>[...]
&gt; git rev-parse origin/${gitlabSourceBranch}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
</code></pre>

<p>So, I've set up a build parameter called <code>GIT_BRANCH</code> with default value <code>master</code>, as <code>${gitlabSourceBranch}</code> is not being set when building manually. </p>

<p>Long story short. Is is possible to use a condition like <code>origin/${gitlabSourceBranch || GIT_BRANCH}</code> (this one doesn't work, of course)?</p>

<p>Thanks!</p>