Created a simple pipeline job, as follows;

       

      node {
      readFile myFile
      }

       

      where myFile is 'File location' , and received the following error;

      java.nio.file.NoSuchFileException: ...

      If i look in the workspace of the job, the file which was selected as a parameter hasn't bee uploaded into the workspace, this is the bug.

       
       

          [JENKINS-47333] file parameter not working in pipeline job

          Have same problem. Please fix it.

          Alexey Grebenshchikov added a comment - Have same problem. Please fix it.

          Such a shame it isn't working, would be quiet a neat thing to be able to use

          yacoub hossain added a comment - Such a shame it isn't working, would be quiet a neat thing to be able to use

          I have the same problem. In my pipeline I have the following code (slightly modified):

          file (                
            name: "dirinworkspace/file.txt",                                                  
            description: 'A file that should be uploaded'        
          )

          I expect the file to be in workspace/dirinworkspace/file.txt, but it's not there. This problem is at least present in Jenkins 2.113.

          Michiel Westerink added a comment - I have the same problem. In my pipeline I have the following code (slightly modified): file (                   name: "dirinworkspace/file.txt",                                                     description: 'A file that should be uploaded'         ) I expect the file to be in workspace/dirinworkspace/file.txt, but it's not there. This problem is at least present in Jenkins 2.113.

          Hi.

          Any update about this bug? 

          Thanks.

          Nahshon Tsameret added a comment - Hi. Any update about this bug?  Thanks.

          Ben Herfurth added a comment -

          This bug is known for a long time ... when will it be fixed?

          Ben Herfurth added a comment - This bug is known for a long time ... when will it be fixed?

          Alisdair Robertson added a comment - Related:  https://issues.jenkins-ci.org/browse/JENKINS-27413

          Issue still persists today.

          Paolo Lambojon added a comment - Issue still persists today.

          Mark Waite added a comment - - edited

          JENKINS-27413 comments describe why it does not work today and give a strong indication that it won't work in the future.

          I created a small test case that I used to interactively verify the issue exists. The file parameter is accepted as part of the Declarative Pipeline job definition and the job accepts the uploaded file, but the file does not seem to be placed anywhere that I could detect. It was not placed in the workspace of the agent running the job, nor was it placed on the master file system. I believe that the comments from Jesse Glick in JENKINS-27413 explain why the file is not stored anywhere.

          Removed from documentation on jenkins.io July 25, 2019 by PR-2388

          Mark Waite added a comment - - edited JENKINS-27413 comments describe why it does not work today and give a strong indication that it won't work in the future. I created a small test case that I used to interactively verify the issue exists. The file parameter is accepted as part of the Declarative Pipeline job definition and the job accepts the uploaded file, but the file does not seem to be placed anywhere that I could detect. It was not placed in the workspace of the agent running the job, nor was it placed on the master file system. I believe that the comments from Jesse Glick in JENKINS-27413 explain why the file is not stored anywhere. Removed from documentation on jenkins.io July 25, 2019 by PR-2388

            huybrechts huybrechts
            hossaiy yacoub hossain
            Votes:
            20 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: