4

I am running an Automated test suite on jenkins and I am able to get the status of the job using Email ext plugin. I want to include only some part of build log in email is there any way that I can do that using groovy syntax? Any help would be appreciated!

Guru43
  • 101
  • 1
  • 9

1 Answers1

4
def notifyFailed() {
    emailext (
      subject: "FAILED : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
      body: '''<p><font size="8" color="red">Build Failure!</font></p>
    <p>Check console output at &QUOT;<a href='${BUILD_URL}consoleText'>${JOB_NAME} [${BUILD_NUMBER}]</a>&QUOT;</p>
    ${BUILD_LOG_REGEX, regex="^.*?*****.*?$", linesBefore=0, linesAfter=999, maxMatches=10, showTruncatedLines=false,escapeHtml=false}''',
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Guru43
  • 101
  • 1
  • 9