It's all about the answers!

Ask a question

Ant task to update work item with build results


0
1
Ananya Joisa (4552124) | asked Nov 26 '12, 4:15 a.m.
retagged Jun 10 '13, 3:42 p.m. by Morten Madsen (3053149)
Hi All,

I was looking for a task which would update the work item fields. What I am trying to do is copy the result of a build definition and update it in the work item comments field. I found a link :
http://pic.dhe.ibm.com/infocenter/rtc/v2r0m0/index.jsp?topic=/com.ibm.team.build.doc/topics/r_workitempublisher.html

I am looking for a task which has the functionality exactly opposite to this. A task that publishes build information to a work item. Could anyone please guide me.

Thanks for your help!
Ananya

One answer



permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Nov 26 '12, 7:33 a.m.
JAZZ DEVELOPER
Hi Ananya,

I've accomplished this task of automatically commenting in a work item when a build completes with the build results by using build engine participants written in Java.  https://jazz.net/jazz/web/projects/Jazz%20Collaborative%20ALM#action=com.ibm.team.workitem.viewWorkItem&id=240028 is one of our current track build items, and you can see comments from Mr. Build that were automatically added when a build completed.  I'm in the process of writing a blog post with a full description of how I accomplished this.  In the meantime, I'll give you a few pointers....

Build engine participants are pieces of code that can be run before, during, or after a build.  The code to be executed is installed as a plugin in the JBE, and the participant is applied to the Jazz build definition so the engine knows to execute the code.  The JBE takes care of notifying the participant that it should be run; all you have to do is write the code that should be executed at the given time in the build process.  There are four major steps to complete in order to use build engine participants:  writing the build engine participant, installing the build engine participant in the JBE, installing the build definition configuration element and editor extensions in the RTC Eclipse client, and applying the build engine participant to the build.

https://jazz.net/forum/questions/23182/creating-custom-pre-build-and-post-build-options has some sample code for a build engine participant.  https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation explains how to update work items programmatically.  https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples has examples of how to work with the build api.  https://jazz.net/wiki/bin/view/Main/AutomaticWorkItemCommentingForBuilds has more information on the build engine participant I wrote.

Comments
Spencer Murata commented Nov 27 '12, 12:41 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

 To elaborate on the Ant Task part, there is currently no Ant Task that will do what you describe, so you will have to go with a plugin like above.  Assuming that a build participant will still fit into your use case.  If you want an Ant Task like that then you should open an RFE.


~Spencer


Lauren Hayward Schaefer commented Apr 19 '13, 6:38 a.m.
JAZZ DEVELOPER

The blog post where I discuss build engine participants is available here:  https://jazz.net/blog/index.php/2012/12/06/how-we-save-time-with-build-engine-participants-and-you-can-too/


Ralph Schoon commented Apr 19 '13, 7:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.