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

Post Content Param not returning expected type back when using a jsonPath filter #221

Closed mattgrayling closed 1 year ago

mattgrayling commented 2 years ago

Hello,

I may be using the plugin incorrectly if so I apologies. My issue is that I am trying to pull out a value and filter at the same time and the returning value is not of string type like when using no filter below in Scenario (1)

Jenkins Version 2.277.1 Plugin Version - 1.77

Scenario (1) Variable - BRANCH Expression - $.pullRequest.fromRef.id Returns - BRANCH = refs/heads/main

Scenario (2) Variable - BRANCH Expression - $.[?(@.eventKey != "pr:merged:")].pullRequest.fromRef.id Return - BRANCH=["refs/heads/PROP-367"] and BRANCH_0=refs/heads/PROP-367

Would it be possible to have Scenario (2) working like Scenario (1) or is there something wrong with my configuration?

Many Thanks

tomasbjerre commented 2 years ago

Sounds like a JSONPath question that you can ask on Stackoverflow. I dont have a good answer.