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

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

0 votes



2 answers

Permanent link
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:
<buildResultPublisher 
  repositoryAddress=...
  userId=...
  password=...
  buildResultUUID="${buildResultUUID}"
  label="${buildLabel} - ${buildNumber}"/>

Where the buildLabel property is the original label, provided by JBE.


1 vote

Comments

 Please ignore  <="" div=""> in the snippet above -- it's an artifact of the forum software.


Permanent link
@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

0 votes

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

Question asked: May 21 '13, 3:10 a.m.

Question was seen: 4,427 times

Last updated: May 28 '15, 6:39 a.m.

Confirmation Cancel Confirm