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 |
3 answers
![]()
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. |
![]()
Ralph Schoon (63.3k●3●36●46)
| answered Apr 25 '12, 5:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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. |
![]()
Ralph Schoon (63.3k●3●36●46)
| answered May 11 '12, 2:07 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
David,
thanks for the hint, I was not aware and I will look into it! |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.