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

Implementation jobs lost parameters, defined in template job after restart Jenkins

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • ez-templates-plugin
    • None
    • Jenkins = 2.7.3
      ez-templates-plugin = 1.2.0

      Implementation jobs lost parameters, defined in template job after restart Jenkins.

      In template job defined next String parameters:
      GITLAB_PROJECT = project
      GITLAB_GROUP = group

      In implementation job defined next String parameters:
      GITLAB_PROJECT = someProject
      GITLAB_GROUP = someGroup

      Implementation job has checked setting: "Retain local job parameter values"

      Its work as expected, bu after restart Jenkins, we see that implementation job lost all parameters.

      And than we go to template job and without changes press save it (for sync parameters).
      Then go to implementation jobs and enter again default values for this params =(

          [JENKINS-38965] Implementation jobs lost parameters, defined in template job after restart Jenkins

          Marc Carter added a comment -

          Already fixed Alex. Please upgrade to latest.

          Marc Carter added a comment - Already fixed Alex. Please upgrade to latest.

          Using jenkins 2.89.2

          ez templates version 1.3.2

          This issue still applies

          use case:

          job_A is template job with 3 parameters: TEST1, TEST2, TEST3. all with default empty values
          job_B implements this template, TEST1 has default value 'test'
          in advanced options: 'Retain local job parameter values' is enabled.

          All works well untill jenkins restart: after restart all job_B parameters are gone
          job_B job configuration still shows 'This project is parameterized', but no parameters available
          So it seems on jenkins start-up the parameter load fails.

          I created a workaround with a groovy script on jenkins start-up to make sure these parameters appear again, using TemplateUtils.handleTemplateImplementationSaved
          based on: https://stackoverflow.com/questions/38726296/using-the-ez-template-plugin-for-jenkins-through-the-jenkins-job-dsl-doesnt-app

          After execution of this code: all parameters are again available on job_B, except the default parameter value has disappaered.

          So after each jenkins restart, all default values for jobs using the template, have to be re-applied manually.

           

          ellen van ravensteyn added a comment - Using jenkins 2.89.2 ez templates version 1.3.2 This issue still applies use case: job_A is template job with 3 parameters: TEST1, TEST2, TEST3. all with default empty values job_B implements this template, TEST1 has default value 'test' in advanced options: 'Retain local job parameter values' is enabled. All works well untill jenkins restart: after restart all job_B parameters are gone job_B job configuration still shows 'This project is parameterized', but no parameters available So it seems on jenkins start-up the parameter load fails. I created a workaround with a groovy script on jenkins start-up to make sure these parameters appear again, using TemplateUtils.handleTemplateImplementationSaved based on: https://stackoverflow.com/questions/38726296/using-the-ez-template-plugin-for-jenkins-through-the-jenkins-job-dsl-doesnt-app After execution of this code: all parameters are again available on job_B, except the default parameter value has disappaered. So after each jenkins restart, all default values for jobs using the template, have to be re-applied manually.  

          Marc Carter added a comment -

          ellenvr If this (Job DSL vs ez-templates) is still a problem, you need to raise a fresh report with reproducible details.  It is not related to the causes of this one which was fixed in 1.2 timeframe

          Marc Carter added a comment - ellenvr If this (Job DSL vs ez-templates) is still a problem, you need to raise a fresh report with reproducible details.  It is not related to the causes of this one which was fixed in 1.2 timeframe

            drekbour Marc Carter
            buinskii Alexander Buinskii
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: