TFS SDK: request executed yesterday

I can query all assemblies in TeamProject as follows:

var bServer = teamProjectCollection.GetService<IBuildServer>(); IBuildDetail[] builds = bServer.QueryBuilds("myTeamProject"); 

This gives all builds within the given myTeamProject . But I'm only interested in yesterday's builds.

I can filter after I get the results in builds .
However, I am wondering if there is an overload of QueryBuilds() to get assemblies within the time provided.


Background:
In my original TFS build solution, user code activity could catch the BuildDetail properties that are important to us and add them to an Excel worksheet using Microsoft.Office.Interop.Excel.
This was pretty convenient as it happened during the build, and our "BuildLog.xls" was always up to date.

Unfortunately, this led to this problem, so I had to remove the code activity, and I'm currently implementing Plan B: I planned to launch the console application once a day, builds requests for yesterday and adds them to the Excel file.

+4
source share
1 answer

You can create an IBuildDetailSpec object and specify MaxFinishTime (end of time range) and MinFinishTime (start of time range) to get assemblies in the range.

IBuildServer has a method for creating IBuildDetailSpec and a QueryBuilds method for querying with this specification.

+7
source

Source: https://habr.com/ru/post/912438/


All Articles