David Thielen
David Thielen

Reputation: 32926

TFS search bug for filename

How can I search TFS for a bug report where it has a file attachment with a specific filename? I've looked at tthe query fields and none are the filename, or anything like it.

Upvotes: 3

Views: 347

Answers (1)

Johann Blais
Johann Blais

Reputation: 9469

If you can access the database directly, you can query the specific collection database. The table you are looking for is dbo.[WorkItemFiles]

The ID field contains the Work Item ID and the OriginalName contains the file name.

You could use something like this:

SELECT ID 
  FROM [Tfs_YourCollection].[dbo].[WorkItemFiles]
 WHERE OriginalName = 'Filename.extension'
   AND [Historical Removed Date] IS NULL

Upvotes: 2

Related Questions