title: NoSuchFileException in Jenkinsfile
body: <p>I have a problem with my JenkinsFile. When I load groovy script from the same directory, I get this message:</p>
  <blockquote>
  <p>java.nio.file.NoSuchFileException: /u01/jenkins_slave/workspace/SPAC_SPAC_BUILD_POLIGON-1727/build/notificationManager.groovy</p>
  </blockquote>
  <p>I tried changing the path to absolute path &quot;path() + /build/notificationManager.groovy&quot; or only file path like this &quot;notificationManager.groovy&quot; or this &quot;build/notificationManager.groovy&quot;. But I have the same problem in all this cases</p>
  <p>What I do in code:</p>
  <pre><code>def runner = load &quot;build/notificationManager.groovy&quot;
  runner.notifyEmail(&quot;FAILURE&quot;, ${DEVELOPERS})
  </code></pre>
  <p>Groovy function</p>
  <pre><code>def notifyEmail(buildStatus, emailRecipients) {
  
      try {
  
          def icon = &quot;✅&quot;
          def statusSuccess = true
          def hasArtifacts = true
  
          if(buildStatus != &quot;SUCCESSFUL&quot;) {
              icon = &quot;❌&quot;
              statusSuccess = false
              hasArtifacts = false
          }
  
          def body = emailTemplate([
              &quot;jenkinsText&quot;   :   env.JOB_NAME,
              &quot;jenkinsUrl&quot;    :   env.BUILD_URL,
              &quot;statusSuccess&quot; :   statusSuccess,
              &quot;hasArtifacts&quot;  :   hasArtifacts,
              &quot;downloadUrl&quot;   :   &quot;www.downloadurl.com&quot;
          ]);
  
          mail (to: emailRecipients.join(&quot;,&quot;),
              subject: &quot;${icon} [ ${env.JOB_NAME} ] [${env.BUILD_NUMBER}] - ${buildStatus} &quot;,
              body: body,
              mimeType: 'text/html'
          );
  
      } catch (e){
          println &quot;ERROR SENDING EMAIL ${e}&quot;
      }
  }
  </code></pre>