# Problems with setup "Bitbucket webhook trigger" from Job DSL (Bitbucket server integration plugin)

**URL:** <https://community.jenkins.io/t/problems-with-setup-bitbucket-webhook-trigger-from-job-dsl-bitbucket-server-integration-plugin/1009>\
**Category:** Ask a question\
**Tags:** question\
**Created:** [December 13, 2021, 9:08pm UTC](https://community.jenkins.io/t/problems-with-setup-bitbucket-webhook-trigger-from-job-dsl-bitbucket-server-integration-plugin/1009 "2021-12-13T21:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/bartolini/32/667_2.png) [@bartolini](https://community.jenkins.io/u/bartolini)\
**Post date:** [December 13, 2021, 9:08pm UTC](https://community.jenkins.io/t/problems-with-setup-bitbucket-webhook-trigger-from-job-dsl-bitbucket-server-integration-plugin/1009/1 "2021-12-13T21:08:47Z")

</div>

All my jobs are configured by Job DSL. I connect to bitbucket via [Bitbucket Server Integration](https://plugins.jenkins.io/atlassian-bitbucket-server-integration/). Unfortunately, I cannot find how to set “Bitbucket webhook trigger” option from Job DSL:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/1X/f753f94e99d38064c8c242a60f12737a390f7e50.png)

Do you have any suggestions on how to do that?

Here you can find example DSL code:

```auto
multibranchPipelineJob("Repo name") {
        branchSources {
            branchSource {
                source {
                    BbS {
                        id("all-branches")
                        credentialsId("ci.user_password")
                        sshCredentialsId("ci.user")
                        serverId("XXXX")
                        projectName("YYYYYY")
                        repositoryName(repository)
                        mirrorName("")
                        traits {
                            gitBranchDiscovery()
                            headWildcardFilter {
                                includes('*')
                                excludes("")
                            }
                        }
                    }
                }
            }
        }

        triggers {
              //any trigger or something?
        }
}

```

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [December 14, 2021, 5:14am UTC](https://community.jenkins.io/t/problems-with-setup-bitbucket-webhook-trigger-from-job-dsl-bitbucket-server-integration-plugin/1009/2 "2021-12-14T05:14:34Z")

</div>

I don’t know how to do it officially, but you can use configure() to manually submit anything you would via forms.

Be warned, I haven’t done bitbucket work in a while, so I don’t know if it works, but it does load.

> <https://github.com/halkeye/jenkins-jobs/blob/6f7a3e381b560f4f89dcb7a906c2c7ce74e9d91e/jobs.groovy#L155-L168>

Have you tried the job-dsl config viewer at `https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html`

---

<div class="post-metadata">

**Author:** ![bartolini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/bartolini/32/667_2.png) [@bartolini](https://community.jenkins.io/u/bartolini)\
**Post date:** [December 14, 2021, 10:47am UTC](https://community.jenkins.io/t/problems-with-setup-bitbucket-webhook-trigger-from-job-dsl-bitbucket-server-integration-plugin/1009/3 "2021-12-14T10:47:30Z")

</div>

> [@halkeye](#):
>
> Have you tried the job-dsl config viewer at `https://your.jenkins.installation/plugin/job-dsl/api-viewer/index.html`

That’s what I need!  
Thanks to this I found the solution:

```auto
                triggers {
                  BitbucketWebhookMultibranchTrigger {
                      refTrigger(true)
                      pullRequestTrigger(false)
                  }
               }

```

@halkeys big thanks!
