Send email notification only when build log contains a particular string

9 views
Skip to first unread message

Sunshine

unread,
Apr 6, 2018, 8:19:21 AM4/6/18
to Jenkins Users
Hi all
I want to send a email notification only when the build log contains a particular string.
I tried below in pre-send script but it didn't work.
If (build.log.contains("Job is ")) {
Cancel = false;
Else
Cancel = true;
}

Else

Is there a way to mark the job as failure if the build log doesn't contain the word I'm looking for I.e "Job is "
So that I use trigger to send mail only when my build is success.

Kindly help
Reply all
Reply to author
Forward
0 new messages