title: How can I configure Jenkins using .groovy config file to set up 'Build strategies -> Tags' in my multi-branch pipeline?
body: <p>I want something similar for 'Basic Branch Build Strategies' plugin <a href="https://plugins.jenkins.io/basic-branch-build-strategies" rel="nofollow noreferrer">https://plugins.jenkins.io/basic-branch-build-strategies</a></p>
  
  <p>I figure out to make it something like this but it's not working:</p>
  
  <pre><code>      def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits
  
        traits &lt;&lt; 'com.cloudbees.jenkins.plugins.bitbucket.TagDiscoveryTrait' {
            strategyId(3)
        }
  
        traits &lt;&lt; 'jenkins.branch.buildstrategies.basic.TagBuildStrategyImpl' {
            strategyId(1)
        }
  </code></pre>
  
  <p>Here you can find full config file: <a href="https://gist.github.com/sobi3ch/170bfb0abc4b7d91a1f757a9db07decf" rel="nofollow noreferrer">https://gist.github.com/sobi3ch/170bfb0abc4b7d91a1f757a9db07decf</a></p>
  
  <p>The first trait is working fine 'TagDiscoveryTrait' but second (my change) doesn't apply on Jenkins restart, 'TagBuildStrategyImpl'.</p>
  
  <p>How can I configure 'Build strategies -> Tags' in .groovy config for my multibranch pipeline using 'Basic Branch Build Strategies' plugin?
  <a href="https://i.stack.imgur.com/wL6bA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wL6bA.png" alt="enter image description here"></a></p>
  
  <p>UPDATE: Maybe I don't need to use traits at all. Maybe there is a simpler solution. I'm not expert in Jenkins groovy configuration.</p>
  
  <p>UPDATE 2: This is scan log for my code <a href="https://gist.github.com/sobi3ch/74051b3e33967d2dd9dc7853bfb0799d" rel="nofollow noreferrer">https://gist.github.com/sobi3ch/74051b3e33967d2dd9dc7853bfb0799d</a></p>