Send email from Custom Build Task
Hi,
I'm working on a custom ant task for a customer. One of their requirements is to have some type of notification when builds fail. Are there API's to utilize RTC Mail Notifications for something like this?
Ant includes an EmailTask, so if I could simply pull the mail host and port that would work too. I'd like to make the code as robust as possible and not have to hard code anything.
Thanks,
Scott
I'm working on a custom ant task for a customer. One of their requirements is to have some type of notification when builds fail. Are there API's to utilize RTC Mail Notifications for something like this?
Ant includes an EmailTask, so if I could simply pull the mail host and port that would work too. I'd like to make the code as robust as possible and not have to hard code anything.
Thanks,
Scott
3 answers
...
One of their requirements is to have some type of notification when builds fail.
...
Not sure if you are aware, but if you are using a build definition in RTC, you can add the "Email Notification" post-build participant to the build definition. On this "Email Notification" page, you can add a new notification criteria, and check-off "Send notifications when a build as completed" --> "Only if there are errors" (assuming that's what you want), or you can customize it as you see fit. You can do this per build definition, or you can set this up at the project area level so that it applies to all build definitions in that project area. To do this, open the project area editor --> Process Configuration --> Project Configuration --> Configuration Data --> Build --> Email Notification.
Scott,
the com.ibm.team.repository.service.MailSender seems not to be availabe in the client libraries. I would assume you would not be able to access the advanced properties either. Your task could leave some data in the build result and have a server side extension to do the e-mail. Otherwise, I assume, you would have to use the Ant task and store the mail information in the build scripts.
the com.ibm.team.repository.service.MailSender seems not to be availabe in the client libraries. I would assume you would not be able to access the advanced properties either. Your task could leave some data in the build result and have a server side extension to do the e-mail. Otherwise, I assume, you would have to use the Ant task and store the mail information in the build scripts.