This how I did it by querying the TfsWorkItemTracking
database directly. I would assume that Fld10005
may or may not be the same on other instances of TFS. The fields can be found in the dbo.Fields
table.
with [project-nodes] (
ID,
[Name],
[Path],
[Depth])
as (
select
t.ID,
t.Name,
cast(t.Name as varchar(max)) as [Path],
0 as [Depth]
from dbo.TreeNodes t
where t.ID = 220
union all
select
c.ID,
c.Name,
cast(p.[Path] + '/' + c.Name as varchar(max)),
[Depth] + 1
from dbo.TreeNodes c
inner join [project-nodes] p
on c.ParentID = p.ID)
select
t.[Path] as [Area Path],
l.Title,
l.Fld10005 as [Resolved Date],
f.OriginalName
from dbo.WorkItemsLatest l
inner join [project-nodes] t
on l.AreaID = t.ID
inner join dbo.WorkItemFiles f
on l.ID = f.ID
where f.OriginalName like '%.sql'
and l.Fld10005 > '2010-05-21' -- ResolvedDate
order by
t.Name