0

How to enable in a Jenkins job DSL for a multibranch pipeline the behavior Filter by name (with wildcards). I tried it in following way but it didn't work.

configure { def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits traits << 'org.jenkinsci.plugins.github__branch__source.WildcardSCMHeadFilterTrait' { excludes("production") includes("*") } }

1 Answers1

0
    traits << 'jenkins.scm.impl.trait.WildcardSCMHeadFilterTrait' {
        includes('master PR-*')
    }

worked for me to add the entry to behaviors.

jgsogo
  • 706
  • 1
  • 9
  • 18