This page last changed on Feb 24, 2009 by bmccoy.

The following REST methods allow you to retrieve various lists of the build results. The following methods require authentication and results will be restricted by the user's permissions.

A lot of these methods return build result data. You can find more information on the data returned at the bottom of the page


Get Latest Build Result For Plan

Provides the last build result for the given buildKey.

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method
buildKey Key representing the build plan to obtain latest build result for

URL:

/api/rest/getLatestBuildResults.action

Successful Response

<response>
    ...
    Build result data (see below)
    ...
</response>

Get Recently Completed Build Results For Plan

Provides the overall most recently completed build results for the given build (as opposed to getLatestBuildResults, which gives the most recent build result for the build).

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method
buildKey Key representing the build plan to obtain latest build results for.

URL:

/api/rest/getRecentlyCompletedBuildResultsForBuild.action

Successful Response:

<response>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
</response>

Get Latest Build Results For Project

Provides the latest result for each build in the given project.

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method.
projectKey Key representing the project to obtain latest build results for.

URL:

/api/rest/getLatestBuildResultsForProject.action

Successful Response:

<response>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
</response>

Get Recently Completed Build Results For Project

Provides the overall most recently completed build results for the given project (as opposed to getLatestBuildResultsForProject, which gives the most recent build result for each build in the project).

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method.
projectKey Key representing the project to obtain latest build results for.

URL:

/api/rest/getRecentlyCompletedBuildResultsForProject.action

Successful Response:

<response>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
</response>

Get Latest Builds By User

Returns recent builds triggered by a particular author.

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method.
username Username

REST:

/api/rest/getLatestBuildsByUser.action

Successful Response:

<response>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
    <build>
          ...
          Build result data (see below)
          ...
    </build>
</response>

Get Latest Builds For Users Favourite Plans

Provides the latest build details for each plan in the user's list of favourite plans.

Arguments:

Parameter Name Description
auth Authentication token retrieved via the login method.
username the username of the user to grab the fouvourits for

URL:

/api/rest/getLatestUserBuilds.action

Successful Response:

<response>
    <build>
        <name>Confluence Stable - LDAP User Management</name>
        <key>CONFSTABFUNC-LDAP</key>
        <state>success</state>
        <buildNumber>146</buildNumber>
        <failedTestCount>0</failedTestCount>
        <successfulTestCount>4</successfulTestCount>
        <buildTime>2008-02-12 23:21:41</buildTime>
    </build>
    <build>
        <name>Confluence Stable - Main Build</name>
        <key>CONFSTAB-MAIN</key>
        <state>failed</state>
        <buildNumber>10</buildNumber>
        <failedTestCount>3</failedTestCount>
        <successfulTestCount>10</successfulTestCount>
        <buildTime>2008-02-12 12:02:14</buildTime>
    </build>
</response>
Element Description Value Range
name Build Name User Friendly Build Name as shown in Bamboo
key Build Key String Identifier for the plan (in the format <projectKey>-<planKey>)
state Build State current (currently building) / success / fail / none
buildNumber Number for the last build result Number > 0
failedTestCount Number of failed tests for this build Number >= 0
successfulTestCount Number of successful tests in this build Number >= 0
buildTime The time the build was started Readable string representation of the time

Build Result Data

Many of the methods above will return a build result with the following information.

Element Description Value Range
projectName Name of the build's project User friendly name for the project
buildName Name of the plan User friendly name for the plan (does not include project name)
buildKey Plan Key Identifier for this plan in the format <projectKey>-<planKey>
buildState State of the Build
Successful / Failed
buildNumber The number of the build
Number > 0
failedTestCount The number of tests that failed
Number >= 0
successfulTestCount The number of tests that passed
Number >= 0
buildTime Time stamp of when the build started
Formatted Date (yyyy-MM-dd HH:mm:ss)
buildCompletedDate Time stamp of when the build finished
Formatted Date(yyyy-MM-dd'T'HH:mm:ssZ)
buildDurationInSeconds How long the build took
Number of seconds
buildDurationDescription How long the build took
Pretty Print of duration
buildRelativeBuildDate How long ago the build occurred
Pretty Print of duration since the build occurred
buildTestSummary Summary of the test resulys
Prrety Print summary of test results
buildReason Why the build occurred
String representation of the trigger reason
commits List of any commits included in this build
 
commit An individual commit included in this build
 
commit: author The author that made the commit
The author name as provided by the vcs system

Example Response

<projectName>Bamboo</projectName>
<buildName>HEAD</buildName>
<buildKey>BAM-TRUNK</buildKey>
<buildState>Successful</buildState>
<buildNumber>4681</buildNumber>
<failedTestCount>0</failedTestCount>
<successfulTestCount>1497</successfulTestCount>
<buildTime>2009-02-24 16:39:46</buildTime>
<buildCompletedDate>2009-02-24T16:58:42+1100</buildCompletedDate>
<buildDurationInSeconds>1136</buildDurationInSeconds>
<buildDurationDescription>18 minutes</buildDurationDescription>
<buildRelativeBuildDate>42 minutes ago</buildRelativeBuildDate>
<buildTestSummary>1497 passed</buildTestSummary>
<buildReason>Code has changed</buildReason>
<commits>
<commit author="bob"/>
</commits>

Document generated by Confluence on Mar 09, 2009 17:07