tags:

views:

25

answers:

1

Looking to get an xml feed of just pinned builds. I see that I can filter on successful / unsuccessful builds, but can't find a flag / option to filter by pinned. Any suggestions?

+2  A: 

Have a look at the Rest API from TeamCity

You can load a list of all builds:

http://YOURSERVER/httpAuth/app/rest/builds

The result ist something like this:

<builds nextHref="/httpAuth/app/rest/builds?count=100&amp;start=100" count="100">
   <build id="4324" number="273" status="SUCCESS" buildTypeId="bt9" href="/httpAuth/app/rest/builds/id:4324" webUrl="http://YOURSERVER/viewLog.html?buildId=4324&amp;amp;buildTypeId=bt9"/&gt;
   <build id="4323" number="283" status="ERROR" buildTypeId="bt10" href="/httpAuth/app/rest/builds/id:4323" webUrl="http://YOURSERVER/viewLog.html?buildId=4323&amp;amp;buildTypeId=bt10"/&gt;
   <build id="4322" number="56" status="SUCCESS" buildTypeId="bt44" href="/httpAuth/app/rest/builds/id:4322" webUrl="http://YOURSERVER/viewLog.html?buildId=4322&amp;amp;buildTypeId=bt44"/&gt;
</builds>

By look at the href you can get detailed Info for this Build. And there is an attribute pinned

The count and the start position of the list of build can you control by adding GET Parameters like this: ?count=5&start=200

If you want it for specific Projects or Project Configuratins you have to go this way:

With this API you can retrieve all Projects. (use http://YOURSERVER/httpAuth/app/rest/projects)

With this info you can get the Configurations. (example: http://YOURSERVER/httpAuth/app/rest/projects/id:project3)

Here you get the detail info about a specific configuration: (example: http://YOURSERVER/httpAuth/app/rest/buildTypes/id:bt17

And finally with this list you can get details of this build: (example: http://YOURSERVER/httpAuth/app/rest/builds/id:4144

The result of the last call is something like this:

<build id="4271" number="151" status="SUCCESS" href="/httpAuth/app/rest/builds/id:4271" webUrl="http://YOURSERVER/viewLog.html?buildId=4271&amp;amp;buildTypeId=bt2" personal="false" history="false" pinned="false">
<statusText>Tests passed: 177</statusText>
<buildType id="bt2" name="trunk Legacy" href="/httpAuth/app/rest/buildTypes/id:bt2" projectName="Common" projectId="project2" webUrl="http://YOURSERVER/viewType.html?buildTypeId=bt2"/&gt;
<startDate>20100923T082041+0200</startDate>
<finishDate>20100923T082320+0200</finishDate>
<agent name="buildagent" id="3" href="/httpAuth/app/rest/agents/id:3"/>
<tags/>
<properties>
    <property name="env.SvnSubDirectory" value="trunk"/>
</properties>
<revisions>
    <revision display-version="9335">
        <vcs-root href="/httpAuth/app/rest/vcs-roots/id:1,ver:1" name="Common"/>
    </revision>
</revisions>
<changes href="/httpAuth/app/rest/changes?build=id:4271" count="1"/>
<relatedIssues/>

Noffls