Jenkins 使用createItem远程API和CloudBees文件夹插件创建嵌套作业或子目录

Jenkins 使用createItem远程API和CloudBees文件夹插件创建嵌套作业或子目录,jenkins,jenkins-plugins,cloudbees,Jenkins,Jenkins Plugins,Cloudbees,我正在尝试使用CloudBees文件夹插件和Jenkins远程API创建嵌套目录和作业,以镜像我的SVN存储库的结构 对于子目录,假设我已将config.xml复制到CWD: wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.co

我正在尝试使用CloudBees文件夹插件和Jenkins远程API创建嵌套目录和作业,以镜像我的SVN存储库的结构

对于子目录,假设我已将config.xml复制到CWD:

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo' 
工作。命令完成后,我在仪表板的顶层有一个新创建的foo文件夹。然而,当我尝试:

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo/bar' 
我收到一个错误400:请求错误。我还试着用相同的结果替换name=/foo/bar、name=%2Ffoo%2Fbar和name=foo%2Fbar

同样,使用createItem/from/mode/name API复制内部文件夹时,我也会得到类似的结果:

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/createItem?name=foo/bar&mode=copy&from=foo'
我发现这很不寻常,因为通过web界面,我可以轻松地移动、复制和创建嵌套目录和作业

我正在使用Jenkins 1.569和CloudBees文件夹4.7插件。

名称可能只是一个简单的名称。您要查找的端点位于文件夹上,而不是根级别。因此

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/job/foo/createItem?name=bar'
名称只能是一个简单的名称。您要查找的端点位于文件夹上,而不是根级别。因此

wget --no-proxy --auth-no-challenge --http-user=username --ask-password --header="Content-Type: application/xml" --post-file="dconfig.xml" 'http://ci.mycompany.com/jenkins/job/foo/createItem?name=bar'