12
votes

I've installed Webhook to Jenkins for Bitbucket plugin in bitbucket server. The main goal is that a jenkins build will be triggered after a commit.

After the install I've enabled the plugin: jenkins-url: https://url/jenkins ssh: ssh@git.. (same command is used in SCM plugin jenkins job).

The jenkins job works (git clone etc works) but the plugin isn't working. When I click test on the jenkins webhook plugin it shows me:

Error: Jenkins response: No git jobs using repository: ssh://[email protected] t and branches: master 

The URL is right. So it is used in my jenkins job (and branch master). I've even copied the url from the error as URL in the jenkins job and it is still able to clone the repo. What do I forget?

EDIT:

I found some info that you should enable SCM polling in your job (even if this is polling once in a year). Only than this plugin will work? Is this the normal behaviour? (it seems to fix my issue)

4
Is this for a pipeline job or a config.xml job? The solution differs slightly based on job type as I've worked with both.Wimateeka
This approach does not work with Multibranch Pipeline jobs.alex

4 Answers

11
votes

Yes, you have to check Poll_SCM in the Build Triggers section of your Jenkins Job configuration - I can confirm this. I'm doing the same thing you are and that's how I got it to work - you can find confirmation of such at the Atlassian site

3
votes

Configure your project. Under Triggers, make sure that Poll SCM is checked.

You can enter a schedule if you want, but you don't have to. If no schedule is entered, it should display something like "No schedules so will only run due to SCM changes if triggered by a post-commit hook".

2
votes

For me the problem was that BitBucket was using all lower case git url but jenkins was internally using the url with parts in the original case and therefore it found not machting project. Adding an custom url fixed the issue for me

-1
votes

Enable the SCM polling, leave it blank and don't mention anything in schedular. This way SCM plugin is going to get response from bit bucket, and ignore the error if "No git jobs using repository"- if http status is 200, it should work properly..