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

groovy job copy to sub-folder not working: ‘/’ is an unsafe character

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

       Jenkins.instance.copy is not working anymore since update to 2.249.3

      Following code... 

      def jenkins = Jenkins.instance
      def strTemplateName = 'Folder/_componentTemplate'
      def strNewJobFullName = 'Folder/jobs/01_folder/jobs/jobname'
      def template = jenkins.getItemByFullName(strTemplateName)
      
      // Create new job based on template
      println 'Creating new job: ' + strNewJobFullName;
      def job = jenkins.copy(template,strNewJobPath)
      

       

      ...leads now to the following error:

      hudson.model.Failure: ‘/’ is an unsafe character
         at jenkins.model.Jenkins.checkGoodName(Jenkins.java:4031)
         at hudson.model.ItemGroupMixIn.copy(ItemGroupMixIn.java:238)
         at jenkins.model.Jenkins.copy(Jenkins.java:3995)
         at sun.reflect.GeneratedMethodAccessor1566.invoke(Unknown Source)
         ...

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            vjuranek vjuranek
            Reporter:
            chrop Christian Opitz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: