Allows the user to define a script that is executed to determine if an email should be sent AFTER
the build occurs. The last line of the script should resolve to true to send an email, or false to not send an email.
There are four objects added to the model for the script to use to interact with the build.
- build
- This is the current build, usually a child class of AbstractBuild
- project
- The project object that the current build was started from, usually a child class of AbstractProject
- rooturl
- The Jenkins instance root URL, useful for links.
- out
- A PrintStream that can be used to log messages to the build log.
Example:
// the last line in the script should resolve to a boolean true or false
// only send am email if the build failed and 'mickeymouse' had a commit
build.result.toString().equals('FAILURE') && build.hasParticipant(User.get('mickeymouse'))