Bibucket server trigger Jenkins job on pull request creation

melhossary April 2, 2018

This is obviously a repeated question but we just can't believe that a basic function like this seems to be troublesome for many. First of all we don't understand why the out of the box webhooks is not working with Jenkins, there is absolutely nothing in the logs that explains the I/O reactor stopped error.

We tried to work with Post webhooks add on, it works well except that the pull requests events are not triggering anything at all, only the repository events are working.

We have seen the pull request notifier articles but they are way over kill for what we want, we just want to trigger a jenkins when the pull request is created, anyone has a simple direct solution to achieve this ? Any help or pointers are appreciated.

Thank you

1 answer

0 votes
Imran Khan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2018

Hi @melhossary

The out of webhooks may not work if Jenkins has CSRF protection enabled.  In which case you'll need to pass a special header along with the request sent to Jenkins. Some of this is detailed on this page:  https://support.cloudbees.com/hc/en-us/articles/219257077-CSRF-Protection-Explained. There could be other reasons for errors you're facing.

We have few open suggestions to improve the webhooks:

  1. https://jira.atlassian.com/browse/BSERV-10627
  2. https://jira.atlassian.com/browse/BSERV-10279
  3. https://jira.atlassian.com/browse/BSERV-10278
  4. https://jira.atlassian.com/browse/BSERV-10320

We aim to improve webhooks. I would recommend watching the appropriate issue for updates and comment/vote on them. 

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events