Webhook pipeline job Configuration with Jenkins and bitbucket

Hi Team,

Please help us with the configuration step of Jenkins pipeline job configuration with bitbucket for webhook trigger.

Hello @Ashish and welcome to this community :wave:

Would this help?

Hi Bruno ,

No this was not help as this is for build job and i am struggling with webbook pipeline job configuration in Jenkins with bitbucket for automatic trigger when code is merged on master branch.

1 Like

Hi Team ,

We are seeking help in pipeline job configuration in Jenkins with webbooks for auto trigger of job in bitbucket for master build .

quick help here is highly appreciated .

Hi Ashish

I suggest you have a look at the Generic webhook plugin. I am using this one to build the connection between Jenkins and the bitbucket cloud.

BR

Hi longkang ,

i am using generic webbook plugin for the same but when the code is getting merged on master branch build is not getting generated automatically .

Regards,
Ashish Jha

Hi Ashish,

  1. Try to enable the webhook history in the bitbucket cloud and see if the request was sent or not.

  2. Enable the “Print post content” and “Print contributed variables” in your pipeline to see the full response content.

  3. Mind if you choose to delete the source branch in the pull request, the webhook response will lose the ‘New’ part and that will cause you are not getting the JSON fields you were wish to see.
    See: Event payloads | Bitbucket Cloud | Atlassian Support

BR
longkang

Hi longkang

i have enabled both the option suggested above in the generic webbook trigger plugin in Jenkins pipeline job still the job is not getting triggered automatically .

Requesting your help in providing the configuration step for the same .

Regards,
Ashish Jha

Hi @Ashish

This is one of the variable I got from the JSON data

This is the " 2. Enable the “Print post content” and “Print contributed variables” in your pipeline to see the full response content." I had mentioned before.

This part you need to fulfill the token and this is important:

This is the Bitbucket config. Mind the token equals to you fulfilled in the last pic:

I think this should be enough. Let me know if this works or not.