title: Make a jenkins build with conditional per branch parameter
body: <p>I currently have a jenkins job that builds my project from the develop branch. We follow a modified gitflow because of some technical constraints. </p>
  
  <p>Anyway, basically what I want to do is to add a string parameter that takes a tagname and deploys from <code>refs/tags/${tagname}</code> <strong>tagname</strong> is of course the parameter. I want to make this parameter <strong>optional</strong> so that when this parameter is empty I build the development branch (not the tag).</p>
  
  <p>One solution is duplicating this build job and making the configuration for the deployment with a parameter but I want to know if there is a way of modifying this job to make a build according to a tag (so a branch different than the develop branch)</p>
  
  <p>I've tried looking everywhere but can't find any information on how to introduce an optional branch build according to a parameter in the source code management section of jenkins. I am checking multibranch pipeline configution currently...</p>