jenkinsci / jenkinsci/parameterized-trigger-plugin

[JENKINS-43181] Unable to use the same buildWithParameter variable webhook across different repositories

Open
#717 1 comment 0 reactions 0 assignees View on GitHub
component:parameterized-trigger-plugin imported-jira-issue priority:blocker resolution:unresolved
Dominant language
Java
Stars
77
Forks
174
Avg merge
22h 27m
Merged PRs (30d)
1

Description

I have a single job parameterized to accept a single parameter 'git_repo'. The goal is for a single job to be triggered remotely using a github webhook and pass a unique value for git_repo which matches the source repo which triggered the build.

The build then substitutes the git_repo variable throughout the job during various build/post build phases (used for checking out code : https://github.com/${git_repo}.git) This works for a single repo,the problem is when I try to use this same webhook  in a different repo.

Steps to reproduce: 

Create freestyle job using 'this build is parameterized' with a string parameter called git_repo with no default value or description. 

Set the job trigger as trigger builds remotely (e.g., from scripts).

Setup the job to Delete the workspace before the build, and for Source Code Management, add additional repo behaviors :  clean before checkout,  wipeout repo and force clone  and clean after checkout are all set (these were attempts to solve this issue but none of these have worked)

In github setup webhook for RepoA : 

https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoA

Fire the webhook and see jenkins successfully take parameter and check out the git repo URL with the substituted parameter.

In Github setup webhook for RepoB:

https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoB

Trigger the webhook to test it's connection to jenkins and see the stack trace and 500 http response : 

Caused by: java.lang.IllegalArgumentException: Illegal number of parameter values for repository: 2

Full stack trace is attached.

Job template is attached.

 

 

 

 

---
Originally reported by mshate123, imported from: Unable to use the same buildWithParameter variable webhook across different repositories


  • assignee: huybrechts
  • status: Open
  • priority: Blocker
  • component(s): parameterized-trigger-plugin
  • label(s): github-plugin, parameterized-trigger, plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

I have a single job parameterized to accept a single parameter 'git_repo'. The goal is for a single job to be triggered remotely using a github webhook and pass a unique value for git_repo which matches the source repo which triggered the build.

The build then substitutes the git_repo variable throughout the job during various build/post build phases (used for checking out code : https://github.com/${git_repo}.git) This works for a single repo,the problem is when I try to use this same webhook  in a different repo.

Steps to reproduce: 

Create freestyle job using 'this build is parameterized' with a string parameter called git_repo with no default value or description. 

Set the job trigger as trigger builds remotely (e.g., from scripts).

Setup the job to Delete the workspace before the build, and for Source Code Management, add additional repo behaviors :  clean before checkout,  wipeout repo and force clone  and clean after checkout are all set (these were attempts to solve this issue but none of these have worked)

In github setup webhook for RepoA : 

https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoA

Fire the webhook and see jenkins successfully take parameter and check out the git repo URL with the substituted parameter.

In Github setup webhook for RepoB:

https://myjenkins.com/buildByToken/buildWithParameters?job=jenkinsjobname&token=tokenvalue&git_repo=RepoB

Trigger the webhook to test it's connection to jenkins and see the stack trace and 500 http response : 

Caused by: java.lang.IllegalArgumentException: Illegal number of parameter values for repository: 2

Full stack trace is attached.

Job template is attached.

 

 

 

 

environment

```
JENKINS_VERSION=2.19.4, Docker container w/ persistent storage for config.xml.,

Attached jenkins system properties for complete info.
```

3 attachments

- [JenkinsJobConfigXML.xml](https://issues.jenkins.io/secure/attachment/36812/JenkinsJobConfigXML.xml)
- [JenkinsSystemProperties.txt](https://issues.jenkins.io/secure/attachment/36813/JenkinsSystemProperties.txt)
- [ParameterStackTraceError.txt](https://issues.jenkins.io/secure/attachment/36814/ParameterStackTraceError.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.