It seems no overloads of IBuildServer.QueryBuilds(...)
allows me to do that.
Here's my code:
TfsTeamProjectCollection tfs = context.GetValue(TeamProject);
IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer));
buildServer.QueryBuilds( // **what should i put here?**
I don't want to specify the build definition, because the build I want may be of any type.
This question seems easy, but googling it gave me no answers.
This code will get all builds . . . ever
However, you're probably more interested in this code, which enumerates each team project and gets the latest build status for each of the definitions:
You can use the following approach (inspired by the article http://www.incyclesoftware.com/2012/09/fastest-way-to-get-list-of-builds-using-ibuildserver-querybuilds-2/):
Benefit - much faster response (from my own tests - about 50 times faster!)