Ant task to update work item with build results
Ananya Joisa (45●6●21●24)
| asked Nov 26 '12, 4:15 a.m.
retagged Jun 10 '13, 3:42 p.m. by Morten Madsen (305●32●50)
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
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 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
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/
Here is a couple of examples for custom ANT tasks from Robin Bobbitt which would be an option: http://ryehle.wordpress.com/2011/12/21/adding-a-custom-ant-task-to-your-build-toolkit/ and http://ryehle.wordpress.com/2012/05/01/sample-custom-ant-task/ in this context this is also interesting: http://ryehle.wordpress.com/2011/11/21/finding-the-right-service-api-for-your-process-extension/
|
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.