A Git webhook is used to send information to other applications or servers via HTTP POST to their URL when Backlog’s Git repository experiences a push. A Git webhook can be used to:
- Trigger a Continuous Integration (CI) build
- Update a backup
- Apply the news version to the staging area
- Connect to other external systems
These operations can also be done using the CI server’s polling or cron functions, which regularly poll the Git repository. However, unlike the immediate action of webhooks, polling only accesses the repository periodically so updates could be missed due to the lag time.
To set up webhooks for each repository, go to Project settings > Git settings and enter the webhook URL. Make sure the URL is accessible from the Backlog server. Private server URLs (e.g., located in an intranet) and private network IP addresses (e.g., 192.168.x.x) can’t be used with webhooks.
If you get the following error at the webhook receiving server, try again a few times to resolve it.
- HTTP status code 5xx after POST
To secure information sent during a transmission, specify an HTTPS URL. Information, such as the commit and author’s email, is sent in the following JSON format.
Payload parameters:
JSON data example: