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

CLI update-job and POSTing config.xml cannot remove properties

      The custom workspace of a Jenkins job cannot be removed by the CLI using update-job.

      Steps to reproduce:
      1. Have a job with a custom workspace.
      2. Remove the custom workspace using the Jenkins java CLI (having a second job without the custom workspace and doing <cli> -get-job <second job> | <cli> update-job <job> is how we encountered this problem).
      3. Note that the config.xml of the job no longer references a custom workspace.
      4. Open the job in the Web GUI. Note that the custom workspace is there, and a save of the job without doing any updates will put the custom workspace configuration back into the config.xml file for the job.

      Bottom line - to remove the custom workspace, one either needs to do it via the web GUI, or do a restart of the Jenkins instance after doing it via the CLI.

      Side note: the " and some other characters are save differently when updating a job via the CLI vs. the Web GUI.

      Example: double quotes " will be changed to '"' in config.xml through CLI method.

          [JENKINS-21017] CLI update-job and POSTing config.xml cannot remove properties

          Roy Zeng created issue -
          Sagi Sinai-Glazer made changes -
          Component/s New: cli [ 15624 ]
          Component/s Original: additional-identities [ 17451 ]
          Labels New: gui jenkins
          Jesse Glick made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: cli [ 15624 ]
          Labels Original: gui jenkins New: cli custom-workspace
          Daniel Beck made changes -
          Link New: This issue is duplicated by JENKINS-24657 [ JENKINS-24657 ]
          Daniel Beck made changes -
          Affects Version/s Original: current [ 10162 ]
          Environment Original: Red Hat Enterprise Linux Server release 6.4 (Santiago)
          Virtual Machine
          Summary Original: Jenkins CLI update-job misses custom workspace deletion New: Jenkins CLI update-job and POSTing config.xml cannot remove properties
          Daniel Beck made changes -
          Link New: This issue is duplicated by JENKINS-23291 [ JENKINS-23291 ]
          Daniel Spilker made changes -
          Link New: This issue is blocking JENKINS-26825 [ JENKINS-26825 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "Stack Overflow question (Web Link)" [ 12105 ]
          Jesse Glick made changes -
          Labels Original: cli custom-workspace New: cli custom-workspace xstream
          Jesse Glick made changes -
          URL Original: http://stackoverflow.com/questions/20668266/xstream-null-out-fields-not-mentioned-in-xml-during-in-place-unmarshal
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          Summary Original: Jenkins CLI update-job and POSTing config.xml cannot remove properties New: CLI update-job and POSTing config.xml cannot remove properties

            jglick Jesse Glick
            royzeng Roy Zeng
            Votes:
            16 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: