79573798

Date: 2025-04-14 18:37:25
Score: 0.5
Natty:
Report link

I know this is an old thread, but have you tried using exactly causeString: 'Triggered on $branchName' as @MaratC suggested? I ran into the same issue recently, and the cause was using double quotes. The reason is that double quotes create GStrings, which support string interpolation. When you pass a GString to GenericTrigger, Groovy resolves all variables immediately. As a result, the GenericTrigger configuration gets created with an already resolved string, basically hardcoded with values from this exact job. Now, Jenkins works in the way that it applies updated pipeline configurations only after one build completes, and that's why you see that the values for the cause are taken from the previous build (or a previous different build). You can probably also notice it in the pipeline configuration history. What you need here is a JavaString, which is going to be passed to the constructor unresolved with variable templates, and then the webhook plugin itself is going to resolve those (see Renderer.java).

Reasons:
  • Whitelisted phrase (-1): have you tried
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @MaratC
  • Single line (0.5):
  • Low reputation (1):
Posted by: vallywonka