Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook not triggering #19

Closed
chickenpie3 opened this issue Apr 26, 2019 · 24 comments
Closed

Webhook not triggering #19

chickenpie3 opened this issue Apr 26, 2019 · 24 comments
Assignees
Labels
bug Something isn't working

Comments

@chickenpie3
Copy link

Webhook for pull requests or push are simply not triggering from Bitbucket cloud.
I can see in the Bitbucket webhook logs that the request is sent to jenkins.

I have previously tried a different Bitbucket Push plugin and it triggers properly so I know the webhook url is correct.

I have manually run the job once.

There are no logs that appear in the jenkins console!! Using Jenkins 2.164.1.

Any ideas?

@macghriogair
Copy link
Collaborator

Could you provide the payload being sent by Bitbucket, please?
Also, minimal info about job configuration (Pipeline, freestyle, branch pattern) would be nice.
And, which version of the plugin is installed? Thanks!

@chickenpie3
Copy link
Author

Payload:

{
  "pullrequest": {
    "rendered": {
      "description": {
        "raw": "* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval",
        "markup": "markdown",
        "html": "<ul>\n<li>DEI-8375 Testing jenkins approval</li>\n<li>DEI-8375 Testing jenkins approval</li>\n<li>DEI-8375 Testing jenkins approval</li>\n</ul>",
        "type": "rendered"
      },
      "title": {
        "raw": "DEI-8375 build before merge",
        "markup": "markdown",
        "html": "<p>DEI-8375 build before merge</p>",
        "type": "rendered"
      }
    },
    "type": "pullrequest",
    "description": "* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval",
    "links": {
      "decline": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/decline"
      },
      "commits": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/commits"
      },
      "self": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74"
      },
      "comments": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/comments"
      },
      "merge": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/merge"
      },
      "html": {
        "href": "https://bitbucket.org/directed/install-api-service/pull-requests/74"
      },
      "activity": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/activity"
      },
      "diff": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/diff"
      },
      "approve": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/approve"
      },
      "statuses": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/pullrequests/74/statuses"
      }
    },
    "title": "DEI-8375 build before merge",
    "close_source_branch": true,
    "reviewers": [],
    "id": 74,
    "destination": {
      "commit": {
        "hash": "3a15003477c4",
        "type": "commit",
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/commit/3a15003477c4"
          },
          "html": {
            "href": "https://bitbucket.org/directed/install-api-service/commits/3a15003477c4"
          }
        }
      },
      "repository": {
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service"
          },
          "html": {
            "href": "https://bitbucket.org/directed/install-api-service"
          },
          "avatar": {
            "href": "https://bytebucket.org/ravatar/%7B54c89356-76e8-4b0b-b499-39f5d99d010a%7D?ts=default"
          }
        },
        "type": "repository",
        "name": "install-api-service",
        "full_name": "directed/install-api-service",
        "uuid": "{54c89356-76e8-4b0b-b499-39f5d99d010a}"
      },
      "branch": {
        "name": "develop"
      }
    },
    "created_on": "2019-04-26T22:47:48.707743+00:00",
    "summary": {
      "raw": "* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval\r\n* DEI-8375 Testing jenkins approval",
      "markup": "markdown",
      "html": "<ul>\n<li>DEI-8375 Testing jenkins approval</li>\n<li>DEI-8375 Testing jenkins approval</li>\n<li>DEI-8375 Testing jenkins approval</li>\n</ul>",
      "type": "rendered"
    },
    "source": {
      "commit": {
        "hash": "4a0cb3a29949",
        "type": "commit",
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service/commit/4a0cb3a29949"
          },
          "html": {
            "href": "https://bitbucket.org/directed/install-api-service/commits/4a0cb3a29949"
          }
        }
      },
      "repository": {
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service"
          },
          "html": {
            "href": "https://bitbucket.org/directed/install-api-service"
          },
          "avatar": {
            "href": "https://bytebucket.org/ravatar/%7B54c89356-76e8-4b0b-b499-39f5d99d010a%7D?ts=default"
          }
        },
        "type": "repository",
        "name": "install-api-service",
        "full_name": "directed/install-api-service",
        "uuid": "{54c89356-76e8-4b0b-b499-39f5d99d010a}"
      },
      "branch": {
        "name": "DEI-8375-build-before-merge"
      }
    },
    "comment_count": 0,
    "state": "OPEN",
    "task_count": 0,
    "participants": [],
    "reason": "",
    "updated_on": "2019-04-26T22:47:48.748580+00:00",
    "author": {
      "username": "davidmeunier",
      "display_name": "David Meunier",
      "uuid": "{0bc179c4-b95b-4cc3-b0b6-68a6f17f9ab2}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/users/davidmeunier"
        },
        "html": {
          "href": "https://bitbucket.org/davidmeunier/"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/davidmeunier/avatar/"
        }
      },
      "nickname": "davidmeunier",
      "type": "user",
      "account_id": "5c0185fc0ecb4f1b2ffa8ad9"
    },
    "merge_commit": null,
    "closed_by": null
  },
  "repository": {
    "scm": "git",
    "website": "",
    "name": "install-api-service",
    "links": {
      "self": {
        "href": "https://api.bitbucket.org/2.0/repositories/directed/install-api-service"
      },
      "html": {
        "href": "https://bitbucket.org/directed/install-api-service"
      },
      "avatar": {
        "href": "https://bytebucket.org/ravatar/%7B54c89356-76e8-4b0b-b499-39f5d99d010a%7D?ts=default"
      }
    },
    "project": {
      "key": "DCCS",
      "type": "project",
      "uuid": "{4d74dfcf-bfaf-429c-b1af-93bcb8b88aed}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/teams/directed/projects/DCCS"
        },
        "html": {
          "href": "https://bitbucket.org/account/user/directed/projects/DCCS"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/user/directed/projects/DCCS/avatar/32"
        }
      },
      "name": "DCCS"
    },
    "full_name": "directed/install-api-service",
    "owner": {
      "username": "directed",
      "display_name": "Directed",
      "type": "team",
      "uuid": "{bde741f8-881b-417c-9b36-1dea6a45507e}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/teams/directed"
        },
        "html": {
          "href": "https://bitbucket.org/directed/"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/directed/avatar/"
        }
      }
    },
    "type": "repository",
    "is_private": true,
    "uuid": "{54c89356-76e8-4b0b-b499-39f5d99d010a}"
  },
  "actor": {
    "username": "davidmeunier",
    "display_name": "David Meunier",
    "uuid": "{0bc179c4-b95b-4cc3-b0b6-68a6f17f9ab2}",
    "links": {
      "self": {
        "href": "https://api.bitbucket.org/2.0/users/davidmeunier"
      },
      "html": {
        "href": "https://bitbucket.org/davidmeunier/"
      },
      "avatar": {
        "href": "https://bitbucket.org/account/davidmeunier/avatar/"
      }
    },
    "nickname": "davidmeunier",
    "type": "user",
    "account_id": "5c0185fc0ecb4f1b2ffa8ad9"
  }
}

It is a Free style project. Here is the relevant config.
image

image

@macghriogair
Copy link
Collaborator

Hm, that's strange. After testing with the exact same payload on a local jenkins instance the job gets triggered indeed.

Are you using version 1.5.0 of the plugin? (you can check at <JenkinsURL>/pluginManager/installed).

For further debugging: What do you mean by "there are no logs"? Have you checked the Jenkins system logs? Also, you could try to add a custom log recorder for io.jenkins.plugins.bitbucketpushandpullrequest on all all leves and paste the output here. For instructions see https://wiki.jenkins.io/display/JENKINS/Logging
Bildschirmfoto 2019-04-27 um 23 35 51

@chickenpie3
Copy link
Author

I am using plugin version 1.5.
I have added the logger as you suggested, but nothing appears there when I create a pull request. In fact no system logs appear at all.
What is strange is that bitbucket says it got a 200 response back from the webhook...

Is there anything else you can think of to diagnose this? Is it possible that another plugin is consuming the payload (im not familiar with how jenkins plugins work) ?

@chris248570
Copy link

@chickenpie3 did you resolved your issue.. in my case also exactly facing the same thing.. when I used plugin when a change is pushed to bitbucket my job is triggering in a second..
When I use build with bitbucket ane pull Request plugin facing the same issue...
Exactly I am using the same version plugin and using freestyle job..any solutions to fix this??

@cdelmonte-zg
Copy link
Contributor

Hi @chickenpie3 and @chris248570
yes, you need to deinstall the other Bitbucket Plugin.

@chris248570
Copy link

@cdelmonte-zg but that Jenkins job is not using that plugin... is there any reason behind that.. eventhough job is not using that plugin ??..

@cdelmonte-zg
Copy link
Contributor

cdelmonte-zg commented May 2, 2019

@chris248570 also if the old Bitbucket plugin is only installed but never used in a job, it is always active. So, as soon as a payload is sent to the endpoint http://a-jenkins-server.xxx/bitbucket-hook/ , the old plugin will consume it before the Bitbucket Push And Pull Request Plugin, which will be not triggered. Obviously nothing happens, because the old Bitbucket plugin is not used in whatever job...

@chris248570
Copy link

@cdelmonte-zg thanks my job is triggering now..but the problem is after job completed my bitbucket Pullrequest page is not displaying the Builds.. build results is not displaying in the bitbucket..

@cdelmonte-zg
Copy link
Contributor

@chris248570
Happy to know, now, it's working 👍

Regarding your second question, if I understand it in the right way, this would be a new feature of the plugin. We opened a new ticket to integrate it. Thank you for your suggestion.

If you mean something else, please open a new issue, following the instructions of the related template. Thanks.

@cdelmonte-zg
Copy link
Contributor

@chickenpie3 is this issue solved also for you?

@zadigus
Copy link

zadigus commented May 4, 2019

Hi,

I was not able to make that plugin (1.6.0) work on my jenkins pipeline. I've even tried to manually configure a webhook on my bitbucket repo (which a step that is not necessary on github for example; there the setup of the webhook is automatically done):

image

I set the webhook's address to http://shopozor-ci.hidora.com/bitbucket-hook/ (with the trailing slash) as stated in the documentation.

Then, what happens is the following: upon PR creation, bitbucket's hook gets triggered:

image

Even though the response is 200, nothing special happened in my Jenkins. I was e.g. expecting to see a triggered job --> nothing happened. Then, I tried to gather information on that and I clicked here (BitBucket Hook Log):

image

and here's the feedback I got:

image

Apparently, I must be missing a configuration somewhere. Can someone help me out?

The request body is:

{
  "pullrequest": {
    "rendered": {
      "description": {
        "raw": "",
        "markup": "markdown",
        "html": "",
        "type": "rendered"
      },
      "title": {
        "raw": "test",
        "markup": "markdown",
        "html": "<p>test</p>",
        "type": "rendered"
      }
    },
    "type": "pullrequest",
    "description": "",
    "links": {
      "decline": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/decline"
      },
      "commits": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/commits"
      },
      "self": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14"
      },
      "comments": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/comments"
      },
      "merge": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/merge"
      },
      "html": {
        "href": "https://bitbucket.org/softozor/shopozor-management-frontend/pull-requests/14"
      },
      "activity": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/activity"
      },
      "diff": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/diff"
      },
      "approve": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/approve"
      },
      "statuses": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/pullrequests/14/statuses"
      }
    },
    "title": "test",
    "close_source_branch": false,
    "reviewers": [],
    "id": 14,
    "destination": {
      "commit": {
        "hash": "0e17a0f668bf",
        "type": "commit",
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/commit/0e17a0f668bf"
          },
          "html": {
            "href": "https://bitbucket.org/softozor/shopozor-management-frontend/commits/0e17a0f668bf"
          }
        }
      },
      "repository": {
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend"
          },
          "html": {
            "href": "https://bitbucket.org/softozor/shopozor-management-frontend"
          },
          "avatar": {
            "href": "https://bytebucket.org/ravatar/%7Be0837c14-05ad-42e1-8956-5061aa39b003%7D?ts=js"
          }
        },
        "type": "repository",
        "name": "shopozor-management-frontend",
        "full_name": "softozor/shopozor-management-frontend",
        "uuid": "{e0837c14-05ad-42e1-8956-5061aa39b003}"
      },
      "branch": {
        "name": "master"
      }
    },
    "created_on": "2019-05-04T12:47:26.269420+00:00",
    "summary": {
      "raw": "",
      "markup": "markdown",
      "html": "",
      "type": "rendered"
    },
    "source": {
      "commit": {
        "hash": "03b1d8ea1d96",
        "type": "commit",
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend/commit/03b1d8ea1d96"
          },
          "html": {
            "href": "https://bitbucket.org/softozor/shopozor-management-frontend/commits/03b1d8ea1d96"
          }
        }
      },
      "repository": {
        "links": {
          "self": {
            "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend"
          },
          "html": {
            "href": "https://bitbucket.org/softozor/shopozor-management-frontend"
          },
          "avatar": {
            "href": "https://bytebucket.org/ravatar/%7Be0837c14-05ad-42e1-8956-5061aa39b003%7D?ts=js"
          }
        },
        "type": "repository",
        "name": "shopozor-management-frontend",
        "full_name": "softozor/shopozor-management-frontend",
        "uuid": "{e0837c14-05ad-42e1-8956-5061aa39b003}"
      },
      "branch": {
        "name": "prbuilder"
      }
    },
    "comment_count": 0,
    "state": "OPEN",
    "task_count": 0,
    "participants": [],
    "reason": "",
    "updated_on": "2019-05-04T12:47:26.300210+00:00",
    "author": {
      "username": "zadigus",
      "display_name": "Laurent Michel",
      "uuid": "{00f43f1e-a733-4d8f-9338-a7a1f1bd8308}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/users/zadigus"
        },
        "html": {
          "href": "https://bitbucket.org/zadigus/"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/zadigus/avatar/"
        }
      },
      "nickname": "zadigus",
      "type": "user",
      "account_id": "5abf7574295e614dda805e3f"
    },
    "merge_commit": null,
    "closed_by": null
  },
  "repository": {
    "scm": "git",
    "website": "",
    "name": "shopozor-management-frontend",
    "links": {
      "self": {
        "href": "https://api.bitbucket.org/2.0/repositories/softozor/shopozor-management-frontend"
      },
      "html": {
        "href": "https://bitbucket.org/softozor/shopozor-management-frontend"
      },
      "avatar": {
        "href": "https://bytebucket.org/ravatar/%7Be0837c14-05ad-42e1-8956-5061aa39b003%7D?ts=js"
      }
    },
    "project": {
      "key": "SHOP",
      "type": "project",
      "uuid": "{16daa5c4-53ba-45d9-907a-50f4977b42b7}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/teams/softozor/projects/SHOP"
        },
        "html": {
          "href": "https://bitbucket.org/account/user/softozor/projects/SHOP"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/user/softozor/projects/SHOP/avatar/32"
        }
      },
      "name": "shopozor"
    },
    "full_name": "softozor/shopozor-management-frontend",
    "owner": {
      "username": "softozor",
      "display_name": "softozor",
      "type": "team",
      "uuid": "{aa290efb-e347-457e-a822-702fb6b42923}",
      "links": {
        "self": {
          "href": "https://api.bitbucket.org/2.0/teams/softozor"
        },
        "html": {
          "href": "https://bitbucket.org/softozor/"
        },
        "avatar": {
          "href": "https://bitbucket.org/account/softozor/avatar/"
        }
      }
    },
    "type": "repository",
    "is_private": true,
    "uuid": "{e0837c14-05ad-42e1-8956-5061aa39b003}"
  },
  "actor": {
    "username": "zadigus",
    "display_name": "Laurent Michel",
    "uuid": "{00f43f1e-a733-4d8f-9338-a7a1f1bd8308}",
    "links": {
      "self": {
        "href": "https://api.bitbucket.org/2.0/users/zadigus"
      },
      "html": {
        "href": "https://bitbucket.org/zadigus/"
      },
      "avatar": {
        "href": "https://bitbucket.org/account/zadigus/avatar/"
      }
    },
    "nickname": "zadigus",
    "type": "user",
    "account_id": "5abf7574295e614dda805e3f"
  }
}

You can also find below the list of plugins installed on my jenkins:

JDK Tool Plugin (jdk-tool): 1.2
GIT server Plugin (git-server): 1.7
Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.3.8
Durable Task Plugin (durable-task): 1.29
Subversion Plug-in (subversion): 2.12.1
Plain Credentials Plugin (plain-credentials): 1.5
Pipeline: Step API (workflow-step-api): 2.19
JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1
Pipeline: Multibranch (workflow-multibranch): 2.21
Docker API Plugin (docker-java-api): 3.0.14
SSH Slaves plugin (ssh-slaves): 1.29.4
LDAP Plugin (ldap): 1.20
Resource Disposer Plugin (resource-disposer): 0.12
Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.9
Mercurial plugin (mercurial): 2.6
Pipeline: Nodes and Processes (workflow-durable-task-step): 2.30
Structs Plugin (structs): 1.19
GitHub Branch Source Plugin (github-branch-source): 2.5.1
Credentials Plugin (credentials): 2.1.18
SCM API Plugin (scm-api): 2.4.1
Lockable Resources plugin (lockable-resources): 2.5
Gradle Plugin (gradle): 1.31
Pipeline: Groovy (workflow-cps): 2.67
GitHub Pull Request Builder (ghprb): 1.42.0
Git plugin (git): 3.10.0
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1
Branch API Plugin (branch-api): 2.4.0
JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 1.1.1
Timestamper (timestamper): 1.9
Authentication Tokens API Plugin (authentication-tokens): 1.3
Pipeline: Model API (pipeline-model-api): 1.3.8
GitHub API Plugin (github-api): 1.95
Pipeline: Input Step (pipeline-input-step): 2.10
Token Macro Plugin (token-macro): 2.7
PAM Authentication plugin (pam-auth): 1.5
Job DSL (job-dsl): 1.74
Pipeline: GitHub Groovy Libraries (pipeline-github-lib): 1.0
Pipeline: Basic Steps (workflow-basic-steps): 2.15
Command Agent Launcher Plugin (command-launcher): 1.3
Pipeline: REST API Plugin (pipeline-rest-api): 2.11
JSch dependency plugin (jsch): 0.1.55
Pipeline: Declarative Agent API (pipeline-model-declarative-agent): 1.1.1
SSH Credentials Plugin (ssh-credentials): 1.16
Email Extension Plugin (email-ext): 2.66
JUnit Plugin (junit): 1.27
Ant Plugin (ant): 1.9
Mailer Plugin (mailer): 1.23
Pipeline: Stage Step (pipeline-stage-step): 2.3
Bitbucket Push and Pull Request Plugin (bitbucket-push-and-pull-request): 1.6.0
Build Timeout (build-timeout): 1.19
Pipeline: API (workflow-api): 2.33
Git client plugin (git-client): 2.7.7
Docker Commons Plugin (docker-commons): 1.14
MapDB API Plugin (mapdb-api): 1.0.9.0
Folders Plugin (cloudbees-folder): 6.8
Pipeline: Job (workflow-job): 2.32
Pipeline: SCM Step (workflow-scm-step): 2.7
Credentials Binding Plugin (credentials-binding): 1.18
Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.3.8
GitHub plugin (github): 1.29.4
Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.13
Display URL API (display-url-api): 2.3.1
Pipeline: Stage View Plugin (pipeline-stage-view): 2.11
Pipeline: Declarative (pipeline-model-definition): 1.3.8
Jackson 2 API Plugin (jackson2-api): 2.9.8
Workspace Cleanup Plugin (ws-cleanup): 0.37
OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.5
Matrix Project Plugin (matrix-project): 1.14
bouncycastle API Plugin (bouncycastle-api): 2.17
Matrix Authorization Strategy Plugin (matrix-auth): 2.4.2
Script Security Plugin (script-security): 1.58
Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.5-3.0
Cucumber reports (cucumber-reports): 4.6.0
Pipeline (workflow-aggregator): 2.6
Docker Pipeline (docker-workflow): 1.18
Pipeline: Supporting APIs (workflow-support): 3.3
Pipeline: Build Step (pipeline-build-step): 2.9
Pipeline: Milestone Step (pipeline-milestone-step): 1.3.1

I have jenkins version 2.164.2

@cdelmonte-zg
Copy link
Contributor

Hi @zadigus , just two question:

  1. Did you configure the git repository in your job properly? Can you send a snapshot of it?
  2. Did you trigger for the first time the job manually? That's necessary if you are using a pipeline job.

For the logging, the link that you sent, is actually not working and it will be probably removed in the next release.
Have you checked the Jenkins system logs? Also, you could try to add a custom log recorder for io.jenkins.plugins.bitbucketpushandpullrequest on all all leves and paste the output here. For instructions see https://wiki.jenkins.io/display/JENKINS/Logging

@chickenpie3
Copy link
Author

@chickenpie3 is this issue solved also for you?

I cant simply remove the existing bitbucket plugin as it will affect dozens of jobs. From what you say though, it makes sense that this is my problem.

@zadigus
Copy link

zadigus commented May 4, 2019

@cdelmonte-zg Regarding question 1.:

image

I know it is working because I've already tested that configuration.

Regarding question 2.: no, I haven't triggered the first job manually. Let me try to trigger it once and I'll post the result back here.

@zadigus
Copy link

zadigus commented May 4, 2019

Hmmm it is now working: the jenkins job gets triggered upon PR creation. Is there a way to get the jenkins job's result back to bitbucket's PR?

@chickenpie3
Copy link
Author

I've disabled the previous bitbucket plugin and confirmed that jobs get triggered on PR and Push. But i have a different problem now.
I configured my SCM to build the $BITBUCKET_SOURCE_BRANCH branch so it would build the actual PR, but this variable is not set on repo push. Do you have any suggestions on how i can configure this so the correct branch is built both for PR and Push?

@chris248570
Copy link

@zadigus I also asked the same questions this plugin will make it work in next features.. currently to make it work I am using other plugin which does for us..
Post build action use Bitbucket notify build status plugin.. it works and my pull request is getting build status displaying...

@cdelmonte-zg and how can I set build name as PullrequestId what's the variable I can make build name as Pullrequestid...
I tried pullRequestId it's not displaying anything?? You have any idea which variable need to use to display the PR-Id?

@zadigus
Copy link

zadigus commented May 4, 2019

@chris248570 if I understand you properly my best option is to migrate my repos to github ...

@chris248570
Copy link

@zadigus No..use one more plugin for now to get build status until they released new feature....

@here what's the variable for the PR_ID

@cdelmonte-zg
Copy link
Contributor

Hi @chris248570 did you try to see if what you need is already between the environment variables of Jenkins?
About this problem, please open a new issue following the template, that we created, thanks

@cdelmonte-zg
Copy link
Contributor

@chickenpie3
There is something useful for you in this class?
https://github.com/jenkinsci/bitbucket-push-and-pull-request-plugin/blob/master/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/environment/BitBucketPPRAdditionalParameterRepositoryEnvironmentContributor.java

For issue related to environment variables please open a new issue, I'm going to close the present one.

@cdelmonte-zg
Copy link
Contributor

Hi @chris248570
I just saw, that you already opened the issue 👍

@cdelmonte-zg
Copy link
Contributor

@chris248570 @chickenpie3 for env vars please use the new release bitbucket-push-and-pull-request-1.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants