Hi there,
 
I want to write an email, when the build succeeded (via blue ocean).
Therefore I use the ext email plugin, however I need to build the link via groovy script, I want to add in the body text with groovy:
 
post
{
    success
    {
        script
        {
            def jobList = ${env.JOB_NAME}.tokenize("/")
            def baseJobName = jobList[0];
            jobList.removeAt(0)
            def jobRest = jobList.join("/")
        }
        
        emailext(
                 subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
                 body: """<p>SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
                     <p>Check console output at &QUOT;<a href="" [${env.BUILD_NUMBER}]</a>&QUOT;</p>
                     <p><a href="" [${env.BUILD_NUMBER}]</a></p>
                     """,
                 recipientProviders: [[$class: 'DevelopersRecipientProvider']]
                )
        
    }
}
 
For unkown reason the post action will not be executed and I also do not see any logs why it failed. The log is empty.
How can I send en mail via groovy? Or what is the correct approch the scope, declarative and scripting code?
 
Can anybody help?
 
Regards,
Zack

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/trinity-01e7b29b-2a4d-4be6-ab95-ea372f9afe03-1525341250693%403c-app-gmx-bs30.
For more options, visit https://groups.google.com/d/optout.

Reply via email to