Question: I currently have this:

```
multibranchPipelineJob("myjob") {
  branchSources {
    branchSource {
      source {
        bitbucket {
          credentialsId('bitbucket-login-user-pass')
          repoOwner('myteam')
          repository('myrepo')
          autoRegisterHook(true)
        }
      }
    }
  }
}

```

But I also need to add the following settings:
[![enter image description here](https://i.stack.imgur.com/y4pEO.png)](https://i.stack.imgur.com/y4pEO.png)

How do I add these settings in the config? Are they "traits" where do I go to see what traits I have available?

Answer: 
```
  multibranchPipelineJob('example'){
    branchSources{
      branchSource{
        source{
          bitbucket{
            repoOwner(project)
            repository(name)
            credentialsId('git_user')
            traits {
              bitbucketBranchDiscovery{
                strategyId(1)
              }
            }            
          }
        }
      }
    }

```

Where traits are defined in the [DSL documentation](https://aesvl01.ddns.nl-htc01.nxp.com/jenkins/plugin/job-dsl/api-viewer/index.html#method/javaposse.jobdsl.dsl.DslFactory.multibranchPipelineJob) and the strategyId correct value I found in the [bitbucket plugin source code](https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BranchDiscoveryTrait.java#L190).

Must be easy to discover the rest of the options from here.
I think @prumand provide the best way to investigate the job dsl, below I'm adding example single repo multibranch pipeline from my side:

```
multibranchPipelineJob('/myjob') {

        factory {
            workflowBranchProjectFactory {
                scriptPath('Jenkinsfile')
            }
        }

        branchSources {
          branchSource {
            source {
              bitbucket {
               id('123456789')
               serverUrl('https://bitbucket.org')
               credentialsId('bitbucket-access-id')
               repoOwner('myGroupOrUser')
               repository('myRepository')
               autoRegisterHook(true) // or not

                traits {
                  bitbucketBranchDiscovery {
                    strategyId(3) // 1 - exclude branches that are also filled as PRs, 3 - all branches
                  }
                  bitbucketPullRequestDiscovery {
                    strategyId(1) // 1 - merging PR with the current target branch revision, 2 - current pull request revision
                  }
                }
              }
            }
          }
        }

        orphanedItemStrategy {
          discardOldItems {
            numToKeep(3)
          }
        }

        triggers {
          periodicFolderTrigger {
            interval('86400000') // 1 day
          }
        }

      }

```