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

Ability to filter seperately on each post variable extracted #218

Closed ericklindemannetcom closed 1 year ago

ericklindemannetcom commented 2 years ago

I have a few extracted variables I am trying to filter on. Problem is I am unable to filter per variable.

For example, I may want to filter on commitid is not empty/null and that branch does not start with a particular letter or string and doesn't contain some strings.

Currently it appears that test expression applies evaluates all variables. So if I have an empty commit but the branch passes filter, the build will still trigger.

Unless I am overlooking a regex expression that would filter separately per variable.

If this is currently not possible, can this be added as an enhancement at some point?

Version I am using: 1.72

I will also try to upgrade to latest 1.76

tomasbjerre commented 2 years ago

Can you supply some examples of json where you want to trigger and not trigger?

Like these: https://github.com/jenkinsci/generic-webhook-trigger-plugin/tree/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd