[JIRA] (JENKINS-57190) Getting error in presend script section in POST action
Title: Message Title Alex Earl closed an issue as Not A Defect My guess is that you don't want ${workspace}. There is no binding that is named workspace for a pre-send script. The one coming from the job itself is a String not a FilePath, so you can't do .child() directly on it. In the future please use the mailing lists for questions. Jenkins / JENKINS-57190 Getting error in presend script section in POST action Change By: Alex Earl Status: Open Closed Resolution: Not A Defect Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.198944.1556245962000.13220.1563308700296%40Atlassian.JIRA. For more options, visit
[JIRA] (JENKINS-57190) Getting error in presend script section in POST action
Title: Message Title Shreyas Arjun commented on JENKINS-57190 Re: Getting error in presend script section in POST action Any updates on this ? Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-57190) Getting error in presend script section in POST action
Title: Message Title Shreyas Arjun created an issue Jenkins / JENKINS-57190 Getting error in presend script section in POST action Issue Type: Task Assignee: David van Laatum Components: email-ext-plugin Created: 2019-04-26 02:32 Environment: Local Labels: presendScript post-actions declarative jenkinspipeline Priority: Minor Reporter: Shreyas Arjun My post section code as follows post { always { emailext attachmentsPattern: "Serenity_Test_Results_${env.BUILD_NUMBER}.zip" , presendScript: "def reportPath=${workspace}.child(\"target/serenity-summary.html\")msg.setContents(reportPath.readToString(), \"text/html\")", body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}", subject: "Testing: Jenkins Job Results - Build # ${env.BUILD_NUMBER}", mimeType: 'text/html', to: "x...@abc.com" } } I am getting below error [Pipeline] { (Declarative: Post Actions) [Pipeline] emailext groovy.lang.MissingPropertyException: No such property: jenkins for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:264) at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288) at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292) at org.kohsuke.groovy.sandbox.impl.Checker$checkedGetProperty$0.callStatic(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56) at