You are checking for != "SUCCESS" and then doing your success notification. You probably want to swap the stuff inside the blocks.
On Thu, Feb 2, 2017, 07:08 siva varma Datla <sivavarma...@gmail.com> wrote: > I need an email notification for my job status I have groovy syntax for if > condition please let me know if I am doing it wrong. Using this syntax its > only pushing notification when ever my build is successful its not sending > any kind of notifications for failed build. > > node { > > if (result.toString() != "SUCCESS") { > notifySuccessful() > } else { > notifyFailure() > } > > } > > -- > 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/1f899ca2-9df5-45c3-b96e-0d8684666d3a%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/1f899ca2-9df5-45c3-b96e-0d8684666d3a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAPiUgVf80QF4%3DQRUdnx2fVdkm_SifqvO4TJLivFd6Q03b1NudQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.