I wanted to create a folder for my particular release using curl.
Anyone have tried it ? I used the following command, and that doesn't works for me.
curl -X POST http://MyJenkinsURL/createItem?name=TestingFolder --user MyUsername:API token -H Content-Type:application/x-www-form-urlencoded
If any modifications has to be done for the same command to work or some other commands, please feedback. Thanks in advance.
You need to tell jenkins to use the Folder plugins to do that
curl -XPOST 'http://jenkins/createItem?name=FolderName&mode=com.cloudbees.hudson.plugins.folder.Folder&from=&json={"name":"FolderName","mode":"com.cloudbees.hudson.plugins.folder.Folder","from":"","Submit":"OK"}&Submit=OK' --user user.name:YourAPIToken -H "Content-Type:application/x-www-form-urlencoded"
Here are some samples using jenkins api to manipulate jobs and folders using curl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With