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

Using fileExists in when condition causes exception

      Minimal reproduction:

      pipeline {
         agent any
         stage('when') {
            when { expression { fileExists('my-src-file') } }
            steps { echo '' }
         }
      }

      Stack trace attached.

          [JENKINS-49378] Using fileExists in when condition causes exception

          Andrew Bayer added a comment -

          Whacky! I'm guessing that this has something to do with how I parse/transform/evaluate when conditions...

          Andrew Bayer added a comment - Whacky! I'm guessing that this has something to do with how I parse/transform/evaluate when conditions...

          Robby Pocase added a comment -

          I'll likely retest with the expression impl wrapped in a function. I could see that working if its entirely parse related.

          Robby Pocase added a comment - I'll likely retest with the expression impl wrapped in a function. I could see that working if its entirely parse related.

          Andrew Bayer added a comment -

          Leave this open regardless - I need to figure out how to make ExpressionConditional more resilient for serialization anyway. =)

          Andrew Bayer added a comment - Leave this open regardless - I need to figure out how to make ExpressionConditional more resilient for serialization anyway. =)

          Rene Buergel added a comment -

          Works for me, using Jenkins ver. 2.190.3

          Rene Buergel added a comment - Works for me, using Jenkins ver. 2.190.3

            Unassigned Unassigned
            rpocase Robby Pocase
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: