Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Control send email by script result #63

CaoFangyuan ·

Hi,

I would like to config the task of sending email controlled by script result. The idea is to judge if a specific file existed, if exist, then send email otherwise don't send. The script shows as below, I tried this script in my local computer, it can get the true result, but in quick build side, I still can't get the email notification, and I checked the path of build agent, the file indeed exists, so not sure something wrong here. Thanks for your help.
groovy:
def file1 = newFile("C:/buildagent/buildagent/workspace/root/nsg/mti_component_mfg_test/nand_burn/Product/N38B/git_trigger/release_burn/platform/testflow_diff_report_SDP_mppr18_waveid02.html")
if (file1.exists()) {
return true
}
else{
return false
}

  • replies 5
  • views 256
  • stars 0
robinshen ADMIN ·

Please add a log statement and check the console log of QB to see if file really exists when your script runs:

logger.info("File exists: " + file1.exists());
if (file1.exists()) {
return true
}
else{
return false
}
CaoFangyuan ·

Hi,

I tried this log print, but didn't find this line print in console log, so I move this script to the post execute action for the last build step, it shows File exists: true in console, so not sure why this doesn't work for email setting.
Capture.PNG

robinshen ADMIN ·

Can you please reproduce this issue on a test database and send me [robin AT pmease DOT com] backup of the test database as well as reproducing steps?

CaoFangyuan ·

Hi Robin,

What do you mean by test database? Didn't get your point.

Thanks,
Fangyuan

robinshen ADMIN ·

I mean to set up a new QB instance and add test configuration demonstrating your issue, then backup the database from QB administration page