Number of WorkItems with changesets or linked items with changesets

前端 未结 2 695
予麋鹿
予麋鹿 2021-01-24 09:36

We have a system in use where developers will log a support ticket using a new \'Support Ticket\' work item in TFS 2010. If there\'s a code change as a result they will link the

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-24 09:50

    Run this against your Data Warehouse. This SQL will list all Work Items with their associated Change Sets. I've commented out a few items in the WHERE clause and left them in to give you an idea on what you can filter on as I'm not sure what process template you have setup in TFS.

    The df.FilePath field commented out in the WHERE clause allows you to filter on specific repositories/branches.

    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 DimFile df 
    JOIN FactCodeChurn fcc ON df.FileSK = fcc.FilenameSK
    JOIN FactWorkItemChangeset fwi ON fcc.ChangesetSK = fwi.ChangesetSK
    JOIN DimWorkItem dwi ON fwi.WorkItemID = dwi.System_id
    AND fwi.TeamProjectCollectionSK = dwi.TeamProjectCollectionSK
    AND fwi.RemovedDateTime = CONVERT(DATETIME, N'9999', 126)
    JOIN 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
    

    This code was run against TFS 2013, but I believe the Schema is the same in 2010

提交回复
热议问题