Find successful builds of a Project since a certain date and return start date along with url.

Hi there,

With, TeamCity Professional 2018.1.1 (build 58406)  I use the Rest API call below to get a list of successful build URLs for a project since a certain date (eg: Aug 24th, 2018. )

app/rest/buildTypes/id:FOO/builds?locator=status:SUCCESS,sinceDate:20180824T000000EDT

The problem is, return value does not contain the date that build was started as seen by output below.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <builds count="4" href="/app/rest/buildTypes/id:FOO/builds?locator=status:SUCCESS,sinceDate:20180824T000000EDT">
 
<build id="28904" buildTypeId="FOO" number="3334" status="SUCCESS" state="finished" href="/app/rest/builds/id:28904" webUrl="http://TEAMCITY/viewLog.html?buildId=28904&buildTypeId=FOO" />
 
Is there any way, I can get back the date when that build was started too ?
 Thank you.

 

0
1 comment

Hi,

Yes, after the "locator" string, you can add a "fields" parameter to request additional fields in the response. For example:

app/rest/buildTypes/id:FOO/builds?locator=status:SUCCESS,sinceDate:20180824T000000EDT&fields=build(id,buildTypeId,number,status,state,href,webUrl,startDate)

0

Please sign in to leave a comment.