You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
one build is triggered by several webhooks with the same json schema but different data, see code section 1.
however, only the data of the first webhook is transferred to the variables, see echoes in code section 1.
Triggered on event: storage.afterPropertyCreate name: a value: ["2"]
Triggered on event: storage.afterPropertyCreate name: c value: ["4"]
Triggered on event: storage.afterPropertyCreate name: b value: ["3"]
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on testnode in C:\workspace\tests\generic-webhook-trigger-test
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Print Trigger Source)
[Pipeline] echo
Triggered on event: storage.afterPropertyCreate by: a and ["2"]
[Pipeline] echo
Triggered on event: storage.afterPropertyCreate by: a and ["2"]
[Pipeline] echo
Triggered on event: storage.afterPropertyCreate by: a and ["2"]
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
the pipeline can be seen in fig 2.
pipeline {
agent any
triggers {
GenericTrigger(
genericVariables: [
// expect data of 1. trigger source
[key: 'EVENT_NAME', value: '$.artifactory.webhook.event'],
[key: 'ARTIFACT_NAME', value: '$.artifactory.webhook.data.name'],
[key: 'ARTIFACT_VALUE', value: '$.artifactory.webhook.data.values[*]'],
// expect data of 2. trigger source
[key: 'EVENT_NAME1', value: '$.artifactory.webhook.event'],
[key: 'ARTIFACT_NAME1', value: '$.artifactory.webhook.data.name'],
[key: 'ARTIFACT_VALUE1', value: '$.artifactory.webhook.data.values[*]'],
// expect data of 3. trigger source
[key: 'EVENT_NAME2', value: '$.artifactory.webhook.event'],
[key: 'ARTIFACT_NAME2', value: '$.artifactory.webhook.data.name'],
[key: 'ARTIFACT_VALUE2', value: '$.artifactory.webhook.data.values[*]']
],
causeString: 'Triggered on event: $EVENT_NAME name: $ARTIFACT_NAME value: $ARTIFACT_VALUE',
token: 'abc1234',
)
}
stages{
stage('Print Trigger Source'){
steps{
echo "Triggered on event: ${EVENT_NAME} by: ${ARTIFACT_NAME} and ${ARTIFACT_VALUE}"
echo "Triggered on event: ${EVENT_NAME1} by: ${ARTIFACT_NAME1} and ${ARTIFACT_VALUE1}"
echo "Triggered on event: ${EVENT_NAME2} by: ${ARTIFACT_NAME2} and ${ARTIFACT_VALUE2}"
}
}
}
}
How is it possible to access all data from the different webhooks?
The text was updated successfully, but these errors were encountered:
Version:
Generic Webhook Trigger Plugin 1.67
Jenkins 2.199
My situation:
one build is triggered by several webhooks with the same json schema but different data, see code section 1.
however, only the data of the first webhook is transferred to the variables, see echoes in code section 1.
the pipeline can be seen in fig 2.
How is it possible to access all data from the different webhooks?
The text was updated successfully, but these errors were encountered: