It's all about the answers!

Ask a question

Send email from Custom Build Task


Scott Pecnik (122) | asked Apr 20 '12, 4:46 p.m.
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



permanent link
David Lafreniere (4.8k7) | answered May 11 '12, 12:40 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

...
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.

permanent link
Ralph Schoon (63.5k33646) | 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.

permanent link
Ralph Schoon (63.5k33646) | 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


Register or to post 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.