title: TFS 2018: Gated checkin with build variables
body: <p>In our TFS2018 website I have made build definitions for our development branch and our release branch. The release branches have the following naming convention: Release_yyyy_mm_dd.</p>
  
  <pre><code>DEV Branch
  |
   -- Release Folder
  |   |
  |   -- Release_2018_01_01 Branch
  |   -- Release_2018_01_15 Branch
  |   -- Release_2018_01_29 Branch *current*
  </code></pre>
  
  <p>We have lots of code that needs to be build (<em>MAP</em> the folder) and lots of code that doesn't (<em>CLOAK</em> the folder).</p>
  
  <p>E.g.:  </p>
  
  <pre><code>MAP Release_2018_02_22\ServiceA  
  MAP Release_2018_02_22\ServiceB  
  CLOAK Release_2018_02_22\ServiceC  
  CLOAK Release_2018_02_22\GigsOfDataThatDoesntNeedGetting  
  *repeat this for 50 folders*
  </code></pre>
  
  <p>We release every sprint, so I have to adapt the release branch folder every time. That's why I introduced a build variable $(CurrentReleaseBranch).</p>
  
  <p>E.g:  </p>
  
  <pre><code>$(CurrentReleaseBranch) on the variables TAB set to "Release_2018_02_22".  
  MAP $(CurrentReleaseBranch)\ServiceA  
  MAP $(CurrentReleaseBranch)\ServiceB  
  CLOAK $(CurrentReleaseBranch)\ServiceC  
  CLOAK $(CurrentReleaseBranch)\GigsOfDataThatDoesntNeedGetting  
  *repeat this for 50 folders*
  </code></pre>
  
  <p>I have a gated check in trigger on this build definition, with the option <em>Use workspace mappings for filter</em> checked.
  When checking in code on this branch, a gated check in will not be shown.<br>
  When I use hardcoded paths in the mappings, the gated check in dialog does appear in Visual Studio.<br>
  How can I use variables and still have a gated check in?</p>