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.

Display alert from pre-queue script? #3882

prgross ·

Is it possible to display an alert (or provide some other feedback) from a pre-queue groovy script?

Presently I have a build that does data validation as the first build step. This means users have to wait for their build to run before getting feedback that the input data was invalid.

I'd like to validate the data before queuing the build request, and I need to tell the user what's wrong. I'd envisioned being able to display an alert, but don't know if that's possible.

Writing to the system log is not acceptable (too hard to find an entry, and most users don't know about it).

  • replies 1
  • views 890
  • stars 0
robinshen ADMIN ·

You may consider to send email to build requester if something abnormal happens. Something like below:
groovy:
import com.pmease.quickbuild.util.MiscUtils;
import com.pmease.quickbuild.entitymanager.SettingManager;

if (request.requesterId != null) {
def requester = system.userManager.load(request.requesterId);
def mailSetting = SettingManager.instance.getEmailSetting();
MiscUtils.sendMail(requester.email, null, null, "email subject", "email body", null, mailSetting, "text/html");
}