4

I have a Jenkins job Trigger builds remotely (e.g., from scripts), and bitbucket PULL request HOOK triggers that job we can say everything works fine.

Jenkins is smart to check any change and build them.

On each build there is data that is changed and is sent in json format.

Is there a way to extract that data sent by hooks to Jenkins while using buld trigger already mentioned?

titus
  • 404
  • 6
  • 17
  • is this what you are looking for ? https://github.com/nishio-dens/bitbucket-pullrequest-builder-plugin – divyenduz Jan 20 '15 at 06:56
  • That plugin uses cron-like job to check for new PR. And I have settled for that plugin until I find something more usefull. Thing is that we used gerrit but had to move to BitBucket now some nice features are simply not possibile with BB. – titus Jan 20 '15 at 09:43

2 Answers2

0

I'm not sure how to achieve your goal from BitBucket side, but for every job in Jenkins, there are metadata parameters which you can check by going to a link which looks like that:

http://your-ci-server/job_name/build_number/api/json

Example: https://lel.doesntexist.com/job/geek-kb/job/scripts/job/declarative_pipeline_test/2/api/json

Itai Ganot
  • 10,424
  • 27
  • 88
  • 143
0

You can extract data into variables with the Generic Webhook Trigger Plugin.