With version 5.4 of the Bitbucket server, Atlasian (re-)introduced the webhooks. I tried to configure a webhook to notify our Jenkins 2.83 instance but the request was refused with an "Invalid crumb" message.
Please advise how to connect the new Bitbucket server webhooks to a Jenkins 2.x instance.
Please note that the invoked Jenkins job is of type Pipeline, which executes a parameterized script from an SCM.
Here are the details of the HTTP request and response:
Request details
Event type:
Test connection event
URL endpoint:
https://jenkinshost/view/all/job/playground/job/test_pipeline/buildWithParameters
Headers
X-Request-Id: b346ae6c-f455-43f0-92c4-d5e74f922bfc
X-Event-Key: diagnostics:ping
Body
No headers
-------------------------------------------------------------------------
Response details
HTTP status:
403
Headers
Cache-Control: must-revalidate,no-cache,no-store
Server: Jetty(9.4.z-SNAPSHOT)
X-Content-Type-Options: nosniff
Content-Length: 460
Date: Wed, 11 Oct 2017 05:27:33 GMT
Via: 1.1 localhost (Apache-HttpClient/4.4.1 (cache))
Content-Type: text/html; charset=ISO-8859-1
Body
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /view/all/job/playground/job/test_pipeline/buildWithParameters. Reason:
<pre> No valid crumb was included in the request</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>