How to set git-lfs as an additional checkout behavior using the JCAC plugin? We are using the Jenkins Configuration As Code (JCAC) plugin to automate the jenkins configuration. One of the challenges is to set git-lfs as an additional checkout behavior.

GitLFSPull has to be configured, but it does not seem to be included in the DSL:



The README of the JCAC github repository indicates that support questions should be asked on Gitter

According to this Q&amp;A, GitLFSPull should be an extension:

extensions: [[$class: 'GitLFSPull']]


However, querying for this on the Job DSL page shows that GitLFSPull seems to be omitted:
It seems that it is only possible by using a workaround as depicted in this answer.

After setting gitLFS in the UI, subsequently inspecting the /var/lib/jenkins/jobs/some-job/config.xml file it became obvious that the XML looked as follows:

&lt;traits&gt;
   &lt;jenkins.plugins.git.traits.GitLFSPullTrait&gt;
      &lt;extension class="hudson.plugins.git.extensions.impl.GitLFSPull"/&gt;
   &lt;/jenkins.plugins.git.traits.GitLFSPullTrait&gt;
&lt;/traits


After defining jenkins.plugins.git.traits.GitLFSPullTrait:

jobs:
  - script: &gt;
      multibranchPipelineJob("example") {
        branchSources {
          ...
        }
        configure { node -&gt;
          node / sources / data / 'jenkins.branch.BranchSource' / source / traits {
            'jenkins.plugins.git.traits.GitLFSPullTrait'()
          }
        }
      }


Git-lfs was enabled.