Before you can use webhooks, it needs to be enabled in the Git Integration for Jira webhook settings.
Access the Git Integration for Jira app webhook configuration page:
Go to Jira dashboard menu Git ➜ Manage repositories.
On the sidebar under Git Integration for Jira, click Webhooks.
Enable the webhook feature by setting it to Enabled.
On this page, you can also find the Webhook URL and the Secret key for use with your git host webhook configuration.
The secret key is a secure random-generated alphanumeric string at the time of the Git Integration for Jira app installation.
Disabling, reinstalling or even installing another version of the Git Integration for Jira app does not change the value of the key (for security purposes and unique identity). Administrators can manually change this key to a different value by generating another secret token according to your Git host and organization policies. For instance:
ruby -rsecurerandom -e 'puts SecureRandom.hex(32)'
The secret key also has the same restrictions on the valid set of characters as a regular URL. Invalid characters such as spaces, slashes, colon, etc. are not allowed. The default recommended length for the secret key is 32 chars and the maximum length is 255 chars.
More information on webhooks configuration
For detailed information on setting up webhooks for supported git hosts, see Git Integration for Jira: Integration webhooks.