How to customize the build notification email to contain the build number?
We doesn't store the build artifacts in RTC. So the RTC won't know the build number. There is a place, the Ant build script, RTC has a chance to get the build number there. What I'd like to do is pass the the build number to RTC and display it in the build notification email. I guess there are two questions.
1. How to pass the property in Ant script to RTC? 2. How to customize the build notification email? Thanks, Qunfeng |
2 answers
Nick Edgar (6.5k●7●11)
| answered May 21 '13, 10:38 a.m.
JAZZ DEVELOPER edited May 21 '13, 10:42 a.m.
Hi Qunfeng. For (1), there's no way currently to update a build's properties after the fact (after the build has been requested), but you can make various contributions to the build, either using the Build Toolkit Ant tasks or via Java client API (for advanced scenarios). One option would be to publish a log file (using the logPublisher Ant task) with the build number in its file name and/or contents.
However, for (2), there's unfortunately no way currently to override the format of the build notification emails. There is an existing enhancement request for this here:
See also other items referenced from:
Given these restrictions, probably the simplest approach for now is to use the buildResultPublisher Ant task to change the label of the RTC build (i.e. override the timestamp based one normally assigned by JBE). The emails will then include this updated label.
e.g. if you have a buildNumber Ant property, you can use:
Where the buildLabel property is the original label, provided by JBE.
|
@nedgar
Hi Nick, I had tried your solution for customize the email notification, but it seems doesn't work. I had define the tasks in the top of the build.xml: <taskdef name="buildResultPublisher" classname="com.ibm.team.build.ant.task.BuildResultPublisherTask" /> Then in the trigger_build target I had below codes: <echo message="Before publish: buildID is : ${buildId}"/> <buildresultpublisher repositoryAddress="${repositoryAddress}" userId="${userId}" passwordFile="${passwordFile}" buildResultUUID="${buildResultUUID}" label="${buildId}"/> <echo message="Afterpublish: buildID is : ${buildId}"/> As you can see from the log , I had the buildID property but can't link the updated label in the build result tab: [echo] Before publish: buildID is 20150528-0226 [echo] After publish: buildID is 20150528-0226 Please can you help to take a look? Thanks David |
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.