Class EmailTrigger

    • Constructor Detail

      • EmailTrigger

        @Deprecated
        protected EmailTrigger​(boolean sendToList,
                               boolean sendToDevs,
                               boolean sendToRequestor,
                               boolean sendToCulprits,
                               String recipientList,
                               String replyTo,
                               String subject,
                               String body,
                               String attachmentsPattern,
                               int attachBuildLog,
                               String contentType)
        Deprecated.
      • EmailTrigger

        protected EmailTrigger​(net.sf.json.JSONObject formData)
    • Method Detail

      • trigger

        public abstract boolean trigger​(AbstractBuild<?,​?> build,
                                        TaskListener listener)
        Implementors of this method need to return true if the conditions to trigger an email have been met.
        Parameters:
        build - The Build object after the project has been built
        listener - Used for logging to the build log
        Returns:
        true if the conditions have been met to trigger a build of this type
      • getEmail

        public EmailType getEmail()
        Get the email that is with this trigger.
        Returns:
        the email
      • setEmail

        public void setEmail​(EmailType email)
      • configure

        public boolean configure​(org.kohsuke.stapler.StaplerRequest req,
                                 net.sf.json.JSONObject formData)
      • createMailType

        @Deprecated
        protected EmailType createMailType​(net.sf.json.JSONObject formData)
        Deprecated.
      • createMailType

        protected EmailType createMailType​(org.kohsuke.stapler.StaplerRequest req,
                                           net.sf.json.JSONObject formData)
      • getNumFailures

        protected int getNumFailures​(Run<?,​?> build)
        Determine the number of direct failures in the given build. If it aggregates downstream results, ignore contributed failures. This is because at the time this trigger runs, the current build's aggregated results aren't available yet, but those of the previous build may be.
        Parameters:
        build - The project run to get the number of test failures for.
        Returns:
        The number of test failures for the Run
      • isPreBuild

        public boolean isPreBuild()
        Should this trigger run before the build? Defaults to false.
        Returns:
        true if the trigger should be checked before the build.