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

Jenkins is not triggering build on any pullrequest created in bitbucket repo

      I am using Bitbucket cloud service for repositories and Jenkins for builds. I am able to run my pipeline and trigger automatically when a new push chnages to a specified branch and have multiple jobs. E.g I have dev, stage, production environments for android builds. Whenever some one push to those branches in Bitbucket cloud, so jenkins is able to trigger build automatically against its branches. But I have another job in jenkins which is created for developers to test their code before merging it into other branch.  It is pr job which must execute when someone created any pull request then it should trigger build against it but it is not working.

      I have installed all the plugins mentioned above to fulfill my requirement but jenkins is not able to trigger build when someone created a pull request from any branch to any branch.

      Please suggest some configurations on jenkins side so that it will be able to trigger build when a new pr created or updated.

          [JENKINS-55896] Jenkins is not triggering build on any pullrequest created in bitbucket repo

          Christian Del Monte added a comment - - edited

          the possibilities are two:

          1) the webhook is not correctly configured

          2) you are using another plugin for the pull requests

          Only to be sure: for the pull requests you should send the payload to http://<jenkins-server>/bitbucket-hook/

           

          Christian Del Monte added a comment - - edited the possibilities are two: 1) the webhook is not correctly configured 2) you are using another plugin for the pull requests Only to be sure: for the pull requests you should send the payload to http://<jenkins-server>/bitbucket-hook/  

          Ok, Let me do it and remove rest of them then I'll share my configurations. Give me few minutes.

          Hassaan Sohail added a comment - Ok, Let me do it and remove rest of them then I'll share my configurations. Give me few minutes.

          please, use only the https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin, disable all other Bitbucket related plugins and configure it as shown in the wiki page, only to be sure that it works as aspected 

          Christian Del Monte added a comment - please, use only the  https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin, disable all other Bitbucket related plugins and configure it as shown in the wiki page, only to be sure that it works as aspected 

          I am not able to receive webhook on pull request creation or updation. I am just receiving webhook on push from Bitbucket and I can see this in my logs.

          I am answering your questions. Right now, I am jut using  1 plugin with the name of  Bitbucket Pull request Builder and I am attaching SCM configurations and Build Trigger Configurations with you.

          1:  Image shows my SCM Configurations for Pull request
          -----------------------------------------------------------------------------------------------------------

           

          2:  second image shows Build Trigger configurations.
          ---------------------------------------------------------------------------------------------------------------------------------------------------------

          3: Third image shows Bitbucket webhook settings.

          -----------------------------------------------------------------------------------------------------------------------------------------------------------

          4: Last images shows the logs of Jenkins, Firstly I created pull request and check there were no logs in Jenkins but Bitbucket was saying that Bitbucket send the post request of webhook for pull request but in jenkins logs I am not able to see any receiving. Now I comit to our stagging branch and check if logs are generating and found that jenkins received post request from Bitbucket on which jenkins started build. Have a look in the picture.

          ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

          5: Now its your turn to identify where is the problem because I am not seeing logs on pull request but able to see while push. Let me know what kind of configurations I have to do or need to change.

          Hassaan Sohail added a comment - I am not able to receive webhook on pull request creation or updation. I am just receiving webhook on push from Bitbucket and I can see this in my logs. I am answering your questions. Right now, I am jut using  1 plugin with the name of  Bitbucket Pull request Builder and I am attaching SCM configurations and Build Trigger Configurations with you. 1:   Image shows my SCM Configurations for Pull request -----------------------------------------------------------------------------------------------------------   2:   second image shows Build Trigger configurations. --------------------------------------------------------------------------------------------------------------------------------------------------------- 3:  Third image shows Bitbucket webhook settings. ----------------------------------------------------------------------------------------------------------------------------------------------------------- 4:  Last images shows the logs of Jenkins, Firstly I created pull request and check there were no logs in Jenkins but Bitbucket was saying that Bitbucket send the post request of webhook for pull request but in jenkins logs I am not able to see any receiving. Now I comit to our stagging branch and check if logs are generating and found that jenkins received post request from Bitbucket on which jenkins started build. Have a look in the picture. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 5:  Now its your turn to identify where is the problem because I am not seeing logs on pull request but able to see while push. Let me know what kind of configurations I have to do or need to change.

          all right, I understand... I'm the mantainer of the  https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin...

          I can help you only for this one. I would suggest, you could try to use it disabling the others and configuring it as described or you could send a issue to the mantainers of the plugin you are using: Bitbucket Pull request Builder.

          Please, let me know.

           

          Christian Del Monte added a comment - all right, I understand... I'm the mantainer of the   https://plugins.jenkins.io/bitbucket-push-and-pull-request plugin... I can help you only for this one. I would suggest, you could try to use it disabling the others and configuring it as described or you could send a issue to the mantainers of the plugin you are using: Bitbucket Pull request Builder. Please, let me know.  

          ok thats cool. But once question you still didn't answer, is it matter to see payload of pull request in jenkins logs or not? Because I am only receiving on push, so most probably the problem should be at Bitbucket end, or it is not like that?

          Hassaan Sohail added a comment - ok thats cool. But once question you still didn't answer, is it matter to see payload of pull request in jenkins logs or not? Because I am only receiving on push, so most probably the problem should be at Bitbucket end, or it is not like that?

          Yes, it matters... Actually I tested the payload you sent with I'm the mantainer of the  https://plugins.jenkins.io/bitbucket-push-and-pull-request and I can see it coming.

          But, in this case, you are using the Bitbucket Pull request Builder, so, you need to configure the logger to see the logs of this plugin.

          Sorry for the misunderstandment

          Christian Del Monte added a comment - Yes, it matters... Actually I tested the payload you sent with I'm the mantainer of the   https://plugins.jenkins.io/bitbucket-push-and-pull-request and I can see it coming. But, in this case, you are using the Bitbucket Pull request Builder, so, you need to configure the logger to see the logs of this plugin. Sorry for the misunderstandment

          cdelmonte I tried same your suggestion but it is not working. I am waiting from Bitbucket side if they answer because I am not receiving payload on pr but I am receiving on push.

          Hassaan Sohail added a comment - cdelmonte I tried same your suggestion but it is not working. I am waiting from Bitbucket side if they answer because I am not receiving payload on pr but I am receiving on push.

          cdelmonte great to see this fixed.

          Claas Gunarson added a comment - cdelmonte great to see this fixed.

          jean added a comment -

          Any updates from Bitbucket side? I am facing the same issue, only receiving the payload on push and not receiving it on pull request.

          jean added a comment - Any updates from Bitbucket side? I am facing the same issue, only receiving the payload on push and not receiving it on pull request.

            cdelmonte Christian Del Monte
            hassaancarry Hassaan Sohail
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: