It's all about the answers!

Ask a question

How to retrieve build status using jazz build ant task


Ivy Liu (31) | asked Dec 08 '15, 2:29 a.m.
I'm using Jazz build ant task in Jenkins to request build against existing build defiinition in RTC and want to get  the status of build such as: failed, successful. Below is my ant code to request builld and retrieve build result. But I got the message:  Property "buildStatusProperty" has not been set. Is there anyone know how to got the build status? Thanks!

<target name="requestPersonal" depends="checkEnv" if="${buildPersonal}">
            <requestTeamBuild repositoryAddress="${repositoryAddress}"
                buildDefinitionId="${buildDefinitionId}"
                personalBuild="true"
                resultUUIDProperty="buildResultUUID"
                userId="${userId}"
                passwordFile="${passwordFile}"
                overridePropertiesFile="${overridePropertiesFile}"
                verbose="true"/>
        </target>

<buildResultRetriever repositoryAddress="${repositoryAddress}"
            buildResultUUID="${buildResultUUID}"
            labelProperty="buildLabel"
            deleteAllowedProperty="testDeleteAllowed"
            tagsProperty="buildTags"
            userId="${userId}"
            passwordFile="${passwordFile}"
            buildStatusProperty="buildStatusProperty"
            verbose="true"/>

Accepted answer


permanent link
Krishna Kishore (50112) | answered Dec 08 '15, 4:03 a.m.
JAZZ DEVELOPER
 Hi,

The buildResultRetriever task retrieves the label, deleteAllowed, and tags values from a build result not the build status. To retrieve the build status you can use waitForTeamBuild ant task. This task waits for a build to enter a specified build state and can return the build status and build status. For example 
<waitForTeamBuild repositoryAddress="${repositoryAddress}" 
   userId="${userId}" 
   password="${password}" 
   requestUUID="${buildRequestUUID}" 
   statesToWaitFor="COMPLETED,CANCELED,INCOMPLETE" 
   buildStatusProperty="buildStatus" verbose="true" interval="5" />
will wait for the build to enter COMPLETED or CANCELED or INCOMPLETE states and return the buildStatus value in 'buildStatus'. 

Refer to https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.team.build.doc/topics/r_ant-tasks.html&scope=null for more information on this ant task.

Thanks,
Kishore

Ivy Liu selected this answer as the correct answer

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.