我已在TFS服务器上为Changeset ID创建了SSRS报告。我想添加一个列,该列还将提及与每个变更集ID相关联的任务编号,因为一个变更集ID可能有不同的任务。请问你能给我一些解决方案。
SELECT --distinct [project_name] , ChangeSetId ,CreationDate,Comment,ProviderDisplayName,DisplayName from tbl_changeset as c JOIN tbl_IdentityMap IM ON C.OwnerID = IM.localId JOIN tfs_configuration.dbo.tbl_Identity u ON IM.MasterID = u.Id join [tbl_Version] v on v.VersionFrom = c.ChangeSetId join [dbo].[vw_projects] p on p.DataspaceId = v.ItemDataspaceId where p.project_name = 'XXXX' Order by C.CreationDate, C.ChangeSetID DESC
答案 0 :(得分:0)
我测试了@kevchadders针对TFS 2015所写的query,它运行良好。
因此,您可以根据查询相应地自定义报告。
要查看结果,可以直接在Sql Server上运行以下查询:
SELECT DISTINCT --df.[FileName]
--,df.FilePath
dwi.System_title AS 'Title'
,dcs.ChangesetID AS 'ChangeSetID'
,dwi.System_id AS 'WorkItemID'
,dwi.System_WorkItemType
,dwi.System_State
,dwi.System_CreatedDate
,dwi.System_ChangedDate
FROM [Tfs_Warehouse].[dbo].[DimFile] df
JOIN [Tfs_Warehouse].[dbo].[FactCodeChurn] fcc ON df.FileSK = fcc.FilenameSK
JOIN [Tfs_Warehouse].[dbo].[FactWorkItemChangeset] fwi ON fcc.ChangesetSK = fwi.ChangesetSK
JOIN [Tfs_Warehouse].[dbo].[DimWorkItem] dwi ON fwi.WorkItemID = dwi.System_id
AND fwi.TeamProjectCollectionSK = dwi.TeamProjectCollectionSK
AND fwi.RemovedDateTime = CONVERT(DATETIME, N'9999', 126)
JOIN [Tfs_Warehouse].[dbo].[DimChangeset] dcs ON dcs.ChangesetSK = fcc.ChangesetSK
WHERE dwi.System_revisedDate = CONVERT(DATETIME, N'9999', 126)
--AND df.FilePath LIKE '%$repositorylocation%'
--AND dwi.System_WorkItemType IN ('Product Backlog Item', 'Task', 'Bug')
ORDER BY dcs.ChangesetID
此外,如果要将变更集报告导出为excel,还可以参考此文章:
Find Changeset details for all work items in a TFS Query
<强>更新强>
对于TFS Warehouse无法使用问题:
数据仓库架构已更改,现有仓库数据库已过期。因此,您可以尝试创建新仓库,然后在管理控制台中重建。
参考这篇文章来解决这个问题:http://blogs.ripple-rock.com/richarderwin/2014/11/06/TFSWarehouseTheDatabaseYouSpecifiedCannotBeUsed.aspx