Here's my current code to return all the TFS Test Case work items that have attachments, from a specific project:
public IEnumerable<ITestCase> TestCasesWithAttachments(ITestManagementTeamProject project)
{
return
project.TestCases.Query("SELECT [Id], [Title] FROM WorkItems WHERE State<>'Closed'")
.Where(tc => tc.Attachments.Count > 0);
}
This not efficient because it is checking the attachment count using Linq on the result of the query.
Is there any way to check for test cases with a nonzero attachment count in the WIQL string itself?
I've tried things like SELECT [Id], [Title] FROM WorkItems WHERE State<>'Closed' AND AttachmentCount<>0
to no avail...