It's all about the answers!

Ask a question

Is there a way to pull the change log automatically?


jeff mccallum (302812) | asked Sep 16 '14, 3:26 p.m.
 I would like to download via API or any other method the change log of a build. 
Is this possible?

One answer



permanent link
Winston Enos (33116) | answered Sep 16 '14, 5:34 p.m.
Jeff,

RTC has 2 ways (assuming you are tracking your builds in RTC at the JBE/snapshot level):

1. There is an Ant task for generating a changelog documented at: http://www-01.ibm.com/support/knowledgecenter/SSCP65_5.0.0/com.ibm.team.build.doc/topics/r_generatechangelog.html?lang=en

2. The RTC command-line 'diff' option: http://www-01.ibm.com/support/knowledgecenter/SSCP65_5.0.0/com.ibm.team.scm.doc/topics/compare.html?lang=en

I'm assuing by 'automatically' you want a non-interactive (headless) way or generating this changelog for traceability purposes. I believe the SCM command-line and Ant task source code is in the RTC SDK (could be wrong, I've read this in other forum posts) so you can peek that for a native Java way of working with it.

Comments
jeff mccallum commented Sep 16 '14, 6:49 p.m.

 Winston,

Thanks so much for the reply.

This could be exactly what I want.

I am having an issue though. 
I call the script like this:
C:\open\jazz_ant>ant -v -f test.xml -lib c:\open\jazz_ant\buildtoolkit

And I get:
C:\open\jazz_ant\test.xml:14: Problem: failed to create task or type generateChangeLog
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

        at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:49
      

Total time: 0 seconds




Winston Enos commented Sep 17 '14, 9:51 a.m.

Jeff,

You have to do 2 things to pull in the RTC Ant tasks:

1. The first is expose the RTC Ant jars to Ant's classpath, which you have done above with the '-lib' argument.

2. Then inside your Ant script you have to use <taskdef> on BuildToolkitTaskDefs.xml to actually load the Ant tasks during Ant runtime, just as you would anything else like ant-contrib.
This is in the documentation at: http://www-01.ibm.com/support/knowledgecenter/SSCP65_5.0.0/com.ibm.team.build.doc/topics/r_ant-tasks.html?lang=en

To use these Ant tasks in your scripts, from installdir/buildsystem/buildtoolkit/BuildToolkitTaskDefs.xml, where installdir is the location where you installed the Ant build toolkit, copy the various taskdef entries in the BuildToolkitTaskDefs.xml file to your project's Ant script. You can also use your Ant script to import the taskdef file.

Your answer


Register or to post your answer.