Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bitbucket webhook is not triggering the build in jenkins

I am using Jenkins and bitbucket integrations. I want to trigger a build when a PR is created. I created a webhook on bitbucket its returning 200 response but no build is getting triggered. I have enabled "Build when a change is pushed to BitBucket" option in the build configuration.

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Hakeem Olasupo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 20, 2021

You have to ensure that your Webhook (Settings->Webhooks) is pointing to your Jenkins bitbucket-hook like the following: "https://ci.yourorg.com/bitbucket-hook/". Notice that last "/", without it, the build will not be triggered.

 

After some struggling with the BitBucket plugin, I have managed to get it working. Below is the summary of things I found are necessary for builds to be triggered, but are not obvious from plugin's documentation:

 

Make sure your webhook has repository push trigger enabled. I thought pull request created / updated would suffice (building on PR is what I wanted) but the plugin reacts only to push.

Set your repository URL (in Git plugin) to https://bitbucket.org/REPOSITORY_OWNER/REPOSITORY_NAME. Plugin will not match it if it's the SSH url.

You do need the SCM polling enabled. The plugin itself does not pull the changes. You can leave the schedule field empty, so repository is polled only when the plugin triggers it.

I hope this helps. If the build is still not triggered for you, try enabling logs for the following classes:

 

com.cloudbees.jenkins.plugins.BitbucketHookReceiver

com.cloudbees.jenkins.plugins.BitBucketTrigger

com.cloudbees.jenkins.plugins.BitbucketJobProbe

com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor

com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource

TAGS
AUG Leaders

Atlassian Community Events