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

Job created via REST API attaches to default view (regression in 2.475)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Jenkins=2.479.1
      Drop Down ViewsTabBar plugin=1.7

      Programmatically created jobs (via posting XML to url /createItem/api/json?name=my_job_name) now attached to default view in Jenkins (i can see them in /var/lib/jenkins/config.xml eather, section <views><listView><jobNames>).

      This behavior started since we've updated Jenkins from previous LTS (2.462.3) to current LTS (2.479.1)

      Steps to reproduce:

      1. upgrade to Jenkins 2.479.1
      2. prepare any valid job XML config (see below)
      3. curl -X POST -u "username:api-token" \
             -H "Content-Type: application/xml" \
             --data-binary @job.xml \
             "https://<jenkins_host>/createItem/api/json?name=my_job_name"
        

      Expected:
      Job doesn't attached to any view

      Actual:
      Job attached to default view

      job.xml example:

      <?xml version='1.1' encoding='UTF-8'?>
      <project>
        <description>tst job from API</description>
        <keepDependencies>false</keepDependencies>
        <properties/>
        <canRoam>true</canRoam>
        <disabled>false</disabled>
        <triggers/>
        <builders/>
        <publishers/>
        <buildWrappers/>
      </project>
      

      Jenkins settings:

      Job attached to default view:

        1. image-2024-10-31-19-53-42-792.png
          3 kB
          Andrey
        2. image-2024-10-31-19-56-01-815.png
          20 kB
          Andrey
        3. pipeline-config.xml
          1 kB
          Mark Waite
        4. plugins.txt
          2 kB
          Mark Waite
        5. run-jenkins.sh
          1 kB
          Mark Waite

            basil Basil Crow
            an_nikolaev Andrey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: