jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

Cannot raise trigger coded in the pipeline section #224

Closed JosueTorres closed 2 years ago

JosueTorres commented 2 years ago

Plugin: Version: 1.77 Jenkins 2.319.1

pipeline { agent any triggers { GenericTrigger( genericVariables: [ [key: 'pushedByName', value: '$.resource.pushedBy.displayName'], [key: 'pushedByEmail', value: '$.resource.pushedBy.uniqueName'], [key: 'commits', value: '$.resource.commits'] ], causeString: 'source code push', token: '80077ECCE8414C53AB6FA60C', tokenCredentialId: '', printContributedVariables: true, printPostContent: true, silentResponse: false ) } stages { stage("Git") { steps { script { echo pushedByName echo pushedByEmail echo commits } } } } }

*** No more configuration, only the pipeline

Result: { "jobs": null, "message": "Did not find any jobs with GenericTrigger configured! If you are using a token, you need to pass it like ...trigger/invoke?token=TOKENHERE. If you are not using a token, you need to authenticate like http://user:passsword@jenkins/generic-webhook... " }

If I configure the plugin from the Build Triggers section, it works, but I would like to make it from the pipeline section.

Thank you

JosueTorres commented 2 years ago

I just had to BUILD from the Jenkins Job page, I haven't seen this step from the documentation