After the issue JENKINS-19142 was implemented it is no longer possible, to create a Job in a View by posting the xml in the url .../view/<viewname>/createItem.

          [JENKINS-41128] createItem in View not working when posting xml

          Alex Ellis added a comment - - edited

          +1 this is a blocker for moving from 1.6 to 2.x series for us. The issue exists in both: 2.3 and 2.4 (jenkins:latest and jenkinsci/jenkins on Docker Hub).

          Is there a workaround? mawinter69

          Related: https://issues.jenkins-ci.org/browse/JENKINS-9264

          Alex Ellis added a comment - - edited +1 this is a blocker for moving from 1.6 to 2.x series for us. The issue exists in both: 2.3 and 2.4 (jenkins:latest and jenkinsci/jenkins on Docker Hub). Is there a workaround? mawinter69 Related: https://issues.jenkins-ci.org/browse/JENKINS-9264

          Alex Ellis added a comment -

          Also pinging vlatombe

          Alex Ellis added a comment - Also pinging vlatombe

          Oleg Nenashev added a comment - - edited

          Yep, it seems to be a valid regression for this API. Explicit JENKINS-9264 fix would be really nice

          Oleg Nenashev added a comment - - edited Yep, it seems to be a valid regression for this API. Explicit JENKINS-9264 fix would be really nice

          I agree this is a regression however adding a job to a view programmatically was not documented (at least in the embedded documentation).

          If you check out <jenkins url>/api/, you'll see a Create Job section, which you don't see if you go to <jenkins url>/view/<somelistview>/api/.

          A workaround is to add the job without using the view, then use the view API <jenkins url>/view/<somelistview>/addJobToView to add it to the view.

          Vincent Latombe added a comment - I agree this is a regression however adding a job to a view programmatically was not documented (at least in the embedded documentation). If you check out <jenkins url>/api/ , you'll see a Create Job section, which you don't see if you go to <jenkins url>/view/<somelistview>/api/ . A workaround is to add the job without using the view, then use the view API <jenkins url>/view/<somelistview>/addJobToView to add it to the view.

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/model/ListView.java
          test/src/test/java/hudson/model/ListViewTest.java
          test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml
          http://jenkins-ci.org/commit/jenkins/84d9244520b917629e82b762eb7b7548cf5f6b9f
          Log:
          [FIXED JENKINS-41128] createItem in View not working when posting xml

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/model/ListView.java test/src/test/java/hudson/model/ListViewTest.java test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml http://jenkins-ci.org/commit/jenkins/84d9244520b917629e82b762eb7b7548cf5f6b9f Log: [FIXED JENKINS-41128] createItem in View not working when posting xml

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/ListView.java
          test/src/test/java/hudson/model/ListViewTest.java
          test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml
          http://jenkins-ci.org/commit/jenkins/8f8b058548a4b912d6a9e6fa1a4a0873a70598f7
          Log:
          Merge pull request #2760 from Vlatombe/JENKINS-41128

          [FIXED JENKINS-41128] createItem in View not working when posting xml

          Compare: https://github.com/jenkinsci/jenkins/compare/2a03dda885d8...8f8b058548a4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/ListView.java test/src/test/java/hudson/model/ListViewTest.java test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml http://jenkins-ci.org/commit/jenkins/8f8b058548a4b912d6a9e6fa1a4a0873a70598f7 Log: Merge pull request #2760 from Vlatombe/ JENKINS-41128 [FIXED JENKINS-41128] createItem in View not working when posting xml Compare: https://github.com/jenkinsci/jenkins/compare/2a03dda885d8...8f8b058548a4

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/hudson/model/ListView.java
          test/src/test/java/hudson/model/ListViewTest.java
          test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml
          http://jenkins-ci.org/commit/jenkins/a6672a3bbb263eae99e7505c7d9957c55e294301
          Log:
          [FIXED JENKINS-41128] createItem in View not working when posting xml

          (cherry picked from commit 84d9244520b917629e82b762eb7b7548cf5f6b9f)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/hudson/model/ListView.java test/src/test/java/hudson/model/ListViewTest.java test/src/test/resources/hudson/model/ListViewTest/addJobUsingAPI/config.xml http://jenkins-ci.org/commit/jenkins/a6672a3bbb263eae99e7505c7d9957c55e294301 Log: [FIXED JENKINS-41128] createItem in View not working when posting xml (cherry picked from commit 84d9244520b917629e82b762eb7b7548cf5f6b9f)

            vlatombe Vincent Latombe
            mawinter69 Markus Winter
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: