How to retrieve build status using jazz build ant task
![](http://jazz.net/_images/myphoto/6cd6d305de297fd87a4702bc82772fb6.jpg)
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"/>
<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
![](http://jazz.net/_images/myphoto/6cd6d305de297fd87a4702bc82772fb6.jpg)
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