Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43181

Unable to use the same buildWithParameter variable webhook across different repositories




      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 : 


      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:


      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.







          mshate123 heather noe added a comment -

          huybrechts Are there any update on this issue? 

          mshate123 heather noe added a comment - huybrechts  Are there any update on this issue? 


            huybrechts huybrechts
            mshate123 heather noe
            1 Vote for this issue
            2 Start watching this issue