Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there any way I can customize RTC Build email notifications ?

Is there any way I can customize RTC Build email notifications ?


I want to include some notes and hyperlink to build notifications.
Currently, I don't see a way to customize the view on ver 6.0.6.
If there are any options, please let me know.

Thanks in advance.

0 votes



2 answers

Permanent link

 As far as I can see, there is no way to do this.

0 votes


Permanent link

There is no out-of-the-box way of adding custom text content to the regular build notification emails.


If this is really needed, you can write your own server side plugins or client(build side) contributions to achieve this.

Ex: You can write a plugin that can be registered with your server that will run an async task periodically to scan for completed builds and send the relevant emails out (yes there will be two emails per build, but perhaps better than nothing to get custom emails). This is how the out-of-the-box build email notifications are sent. If this class is visible in the EWM server SDK, see the implementation for com.ibm.team.build.internal.service.notification.BuildNotificationTask. This is essentially a class that extends com.ibm.team.repository.service.async.AbstractAutoScheduledTask, and queries for particular ChangeEvents which represent completed builds.
ex: 
ChangeEventQueryModel model = ChangeEventQueryModel.ROOT;
IItemQuery query = IItemQuery.FACTORY.newInstance(model);
// we want all build changes between a certain date a time, and only those that were originally IN_PROGRESS       

query.filter(model.modified()._gtOrEq(query.newDateTimeArg())._and(model.modified()._lt(query.newDateTimeArg()))._and(                model.eventCategory()._eq(BuildChangeEvent.BUILD_RESULT_CHANGED_EVENT_CATEGORY))._and(
                model.stringExtensions()._eqKeyValue(BuildResultChangeEvent.KEY_OLD_BUILD_STATE,
                        BuildState.IN_PROGRESS.name())));
        query.orderByAsc(model.eventTime());


You can then use Foundation APIs to send emails using an example like:
MailSender sender = getMailerService().getDefaultSender();
getMailerService().sendMail(sender, email, subject, content, null);
 
There are other jazz forum topics that give up to date pointers (to articles/wikis) on how to contribute server side extensions using the public SDK/APIs (I don't have these links handy at the moment, but it should be easy to find if this is the direction you want to persue).

You could also have your build scripts (ex: Ant tasks) send out the appropriate emails, or contribute post-build participants code to a build definition (build public API also supports hooking in custom code for pre/build/post-build callbacks) (however it's probably easier to go with the async serverside task to do this, since this is what is already implemented).

0 votes

Comments

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,122
× 562

Question asked: Dec 14 '22, 4:08 a.m.

Question was seen: 1,594 times

Last updated: Jan 05 '23, 11:10 a.m.

Confirmation Cancel Confirm