Some of our customers wish to pass Branch Name as a Jenkins input parameter for the Packager job so that a specific Datical Pipeline can be targeted. The below steps outline how this can be performed using the Generic Webhook Trigger Plugin.
Generic Webhook Trigger Pluggin
This plugin allows Jenkins access to the HTTP payload that triggered the build. Values, such as Branch name, can be extracted from the payload and used as filters and passed to Jenkins input parameters.
Instructions
In Jenkins, install the Generic Webhook Trigger Pluggin using Manage Jenkins → Manage Plugins
After installing the plugin you will see a checkbox under Build Triggers for Generic Webhook Trigger. Check the box to access the configurations.
In the Post content parameters add a variable, eg. ref. You will need to provide a JSONPath or XPath expression to extract the value from the HTTP payload.
Sample HTTP payload from my Github webhook can be found here -
A JSONPath evaluator can be found here - https://jsonpath.com/
In this example we have two variables:
ref - this will be used to extract the branch name from the SQL Repo triggering the webhook
author - this will be used to extract the author of the change so that Jenkins user can be excluded from the webhook. W