Closed raksit31667 closed 3 years ago
I tried with Jenkins 2.277.4.
Created a secret text
credential with id theid
.
Pipeline:
properties([
pipelineTriggers([
[$class: 'GenericTrigger',
genericVariables: [
[
key: 'href',
value: '$.href'
]
],
causeString: 'Triggered on $ref',
tokenCredentialId: 'theid',
printContributedVariables: true,
printPostContent: true,
silentResponse: false
]
])
])
Trigger with Curl:
curl -vs http://localhost:8080/jenkins/generic-webhook-trigger/invoke?token=abc123 2>&1
Works for me.
Note that you have to run a pipeline once, to apply the properties to the job. So you can verify what has been applied by inspecting the job. In my case I can see:
Hi @tomasbjerre, thank you for your support.
You are right, I missed the part where I needed to run a pipeline once as documented here.
Version report
Jenkins on Docker v2.222 Generic Webhook Plugin v1.72
Reproduction steps
Add new credentials on Jenkins
Configure Job on either UI or DSL script, specify
tokenCredentialId
with the one we have just created.Results
Expected result:
It should return HTTP 200 OK with new job running.
Actual result:
It returns HTTP 404 NOT FOUND without any jobs running.
Additional info
It works if I hardcode
token
input instead of usingtokenCredentialId
.