Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69003

Unable to see the Bitbucket Server Integration plugin option in pipelines

      I followed the documentation for the Bitbucket Server Integration plugin https://plugins.jenkins.io/atlassian-bitbucket-server-integration/ and watched the video https://youtu.be/0-FugzVYJQU . The first part where the Jenkins and Bitbucket servers are configured and the test connection seems to work. However, when I create a Pipeline job the option to use the plugin under the build triggers section is not available. Specifically, the option worded "Bitbucket Server trigger build after push" is missing. It is also missing from a Freestyle job as well.

      I assume this is a bug? What is the workaround? Is there a fix?

          [JENKINS-69003] Unable to see the Bitbucket Server Integration plugin option in pipelines

          Hi Ari, thanks for the ticket.

          We introduced pull request triggers in 3.0.0 so this trigger has changed. Per the readme on step 3, the trigger name has been changed to "Bitbucket webhook trigger". Are you seeing this option in your list of triggers? It should appear on freestyle, pipeline and multibranch pipeline jobs.

          Martin Henschke added a comment - Hi Ari, thanks for the ticket. We introduced pull request triggers in 3.0.0 so this trigger has changed. Per the readme on step 3, the trigger name has been changed to "Bitbucket webhook trigger". Are you seeing this option in your list of triggers? It should appear on freestyle, pipeline and multibranch pipeline jobs.

          Ari Sirin added a comment - - edited

          Hi Martin,

          Thank you for your prompt attention

          I did see that option and I selected it followed by selecting both of the trigger options: Push event and Pull request event.

          At the moment I am using a Pipeline job with a Pipeline script defined in the job. I also just saw that one needs a Jenkinsfile for this to work. I assume since I am using a Pipeline script that is the reason why I haven't seen any build jobs being triggered?

          Ari

          Ari Sirin added a comment - - edited Hi Martin, Thank you for your prompt attention I did see that option and I selected it followed by selecting both of the trigger options: Push event and Pull request event. At the moment I am using a Pipeline job with a Pipeline script defined in the job. I also just saw that one needs a Jenkinsfile for this to work. I assume since I am using a Pipeline script that is the reason why I haven't seen any build jobs being triggered? Ari

          Hi Ari, sorry for the delay.

          I believe there are some known concerns with pipeline files not stored in a script, but I couldn't find an open bug for it. If storing your script in a Jenkinsfile is working, will that serve for you as a serviceable workaround to the issue?

          Either way this merits more investigation, so I'll leave the ticket as is for now

          Martin Henschke added a comment - Hi Ari, sorry for the delay. I believe there are some known concerns with pipeline files not stored in a script, but I couldn't find an open bug for it. If storing your script in a Jenkinsfile is working, will that serve for you as a serviceable workaround to the issue? Either way this merits more investigation, so I'll leave the ticket as is for now

          I've finally done some more investigation on this ticket and I believe we will be closing this as no fix.

          To make sure I fully understand this issue, the replication instructions I took were:

          • Create a new pipeline job
          • Add a bbs_checkout build step
          • Enable a Bitbucket trigger, and save the job

          If no webhook already exists in that repo, it will not be registered, and if one does, this job will never accept it.

          The reason for this is our webhook trigger code relies on the SCM definition of the job for registration and for matching- whenever a webhook is fired, we check if a job has a matching repo in it's SCM definition, and if so, it will trigger. That doesn't work for an SCM script file because you don't specify an SCM, you specify a pipeline step that happens to refer to an SCM step. So the only way we can know this job needs to be triggered is by resolving this pipeline step manually and searching.

          This supposes more about how a trigger works than it actually does- other triggers like poll SCM also will not for the same reason, and so I feel this ticket should be closed. An SCM is required in the job definition for most of the features defined outside of a pipeline file to work. If this is an important requirement I would recommend opening this as a feature request.

          Martin Henschke added a comment - I've finally done some more investigation on this ticket and I believe we will be closing this as no fix. To make sure I fully understand this issue, the replication instructions I took were: Create a new pipeline job Add a bbs_checkout build step Enable a Bitbucket trigger, and save the job If no webhook already exists in that repo, it will not be registered, and if one does, this job will never accept it. The reason for this is our webhook trigger code relies on the SCM definition of the job for registration and for matching- whenever a webhook is fired, we check if a job has a matching repo in it's SCM definition, and if so, it will trigger. That doesn't work for an SCM script file because you don't specify an SCM, you specify a pipeline step that happens to refer to an SCM step. So the only way we can know this job needs to be triggered is by resolving this pipeline step manually and searching. This supposes more about how a trigger works than it actually does- other triggers like poll SCM also will not for the same reason, and so I feel this ticket should be closed. An SCM is required in the job definition for most of the features defined outside of a pipeline file to work. If this is an important requirement I would recommend opening this as a feature request.

            Unassigned Unassigned
            asirin Ari Sirin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: