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

Cannot create a view inside a folder using Jenkins CLI.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • Jenkins 2.505
      cloudbees-folder 6.991.v1d5f531726d0

      When I try to create a new view inside a folder using the Jenkins CLI, I get the following error and the view cannot be created:

      ERROR: Invalid view name: '/' is an unsafe character

      Steps to reproduce:

      1. Create a new folder (e.g. FOLDER01)
      2. Create a new view (e.g. FOLDER01/VIEW01) with the following command
      $ java -jar ./jenkins-cli.jar -s http://{host}:{port}/ -auth {user}:{token} create-view FOLDER01/VIEW01 < config.xml
      ERROR: Invalid view name: '/' is an unsafe character 

      Additional Information:

      I was able to create a job inside a folder using the Jenkins CLI.

      $ java -jar ./jenkins-cli.jar -s http://{host}:{port}/ -auth {user}:{token} create-job FOLDER01/JOB01 < config.xml 

      It seems that the "create-job" command takes into account the creation of views inside folders, while the "create-view" command does not.

      Suggestion:

      I think it would be a good idea to take into consideration the creation of views inside folders in the "create-view" command, just like the "create-job" command.

      CreateJobCommand.java
      CreateViewCommand.java

            ryohsuket Ryohsuke
            ryohsuket Ryohsuke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: