Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to retrieve build status using jazz build ant task

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"/>

0 votes


Accepted answer

Permanent link
 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

1 vote

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,944

Question asked: Dec 08 '15, 2:29 a.m.

Question was seen: 1,997 times

Last updated: Dec 08 '15, 4:04 a.m.

Confirmation Cancel Confirm