I am trying to run a block if a directory exists in my jenkins workspace and the pipeline step \"fileExists: Verify file exists\" in workspace does
You need to use brackets when using the fileExists step in an if condition or assign the returned value to a variable
if
Using variable:
def exists = fileExists 'file' if (exists) { echo 'Yes' } else { echo 'No' }
Using brackets:
if (fileExists('file')) { echo 'Yes' } else { echo 'No' }