tabelle relative alla cronologia dei collegamenti agli elementi di lavoro
È possibile eseguire una query per i collegamenti tra bug, attività e altri tipi di elemento di lavoro usando FactWorkItemLinkHistory e le tabelle delle dimensioni associate. Per includere i dettagli sugli elementi di lavoro collegati, SourceWorkItemID e TargetWorkItemID vengono associati a Dim.System_ID.
Per informazioni sulle misure e le dimensioni associate a queste tabelle nel cubo di SQL Server Analysis Services, vedere Analizzare e generare rapporti su dati relativi agli elementi di lavoro e ai test case tramite la prospettiva Elemento di lavoro.
FactWorkItemLinkHistory è associato alle seguenti tabelle delle dimensioni:
DimTeamProject
DimPerson
DimWorkItem
Nota
Questa tabella contiene collegamenti rimossi.I collegamenti non rimossi hanno RemovedDate impostato su 1 gennaio 9999.Quando un collegamento viene rimosso, la data rimossa viene impostata sulla data e l'ora della rimozione.È possibile usare RemovedDate > GetDate() per filtrare i collegamenti rimossi.
È possibile usare questa query di esempio per trovare i tipi di informazioni seguenti:
numero di ore totale per il lavoro completato
lavoro stimato originale
lavoro rimanente
punti della storia totali per ogni storia utente in un progetto team in un percorso area specificato
Per informazioni sulla funzione Coalesce usata nella query di esempio, vedere la pagina seguente nel sito Web Microsoft: COALESCE (Transact-SQL).
Nota
Questa query presuppone che una storia utente sia collegata agli altri elementi di lavoro tramite collegamenti figlio.
declare @TeamProjectNodeSK int
select @TeamProjectNodeSK = ProjectNodeSK from GetProjectNodeInfoFromReportFolder(N'/TfsReports/VSTSDF/ProcessDev10')
-- This table-value function returns the ProjectNodeSK: the Surrogate Key of a team project under a certain area path.
declare @TeamProjectCollectionGuid nvarchar(36)
select @TeamProjectCollectionGuid = pc.ProjectNodeGUID from DimTeamProject p inner join DimTeamProject pc on p.ParentNodeSK = pc.ProjectNodeSK where p.ProjectNodeSK = @TeamProjectNodeSK
-- This query finds the team project collection GUID by joining TeamProject.ParentNodeSK to TeamProject.ProjectNodeSK
select
wi.System_Title
,wi.System_Id
,coalesce(sum(cwi_child.Microsoft_VSTS_Scheduling_CompletedWork), 0) as Total_CompletedWork -- Finds the total number of hours of completed work.
,coalesce(sum(cwi_child.Microsoft_VSTS_Scheduling_OriginalEstimate), 0) as Total_OriginalEstimate --Finds the total number of hours of original estimate.
,coalesce(sum(cwi_child.Microsoft_VSTS_Scheduling_RemainingWork), 0) as Total_RemainingWork --Finds the total number of hours of remaining work.
,coalesce(sum(cwi_child.Microsoft_VSTS_Scheduling_StoryPoints), 0) as Total_StoryPoints --Finds the total story points.
from
DimWorkItem wi
cross apply
GetWorkItemsTree(@TeamProjectCollectionGuid, wi.System_Id, N'Child', DEFAULT) wit
left join
FactCurrentWorkItem cwi_child
on cwi_child.WorkItemSK = wit.ChildWorkItemSK
where
wi.TeamProjectSK = @TeamProjectNodeSK
and wi.System_WorkItemType = N'User Story'
and wi.System_RevisedDate = CONVERT(datetime, '9999', 126)--The revised date of the work item is equal to today.
and wi.System_State = N'Active'
group by wi.System_Id, wi.System_Title
order by wi.System_Id
Vedere anche
Concetti
Riferimento alla tabella per il database warehouse relazionale per ALM di Visual Studio