TFS Reporting Recipes #1: Get the Iteration Path/GUID for the Current Sprint


no comments


Many times you want to filter the contents of reports based on sprints or iterations (for example, the number of re-opened bugs in each sprint in the project).  In this case, you often want the default of the report filter to show the iteration path of the current sprint.  This query will retrieve the current sprint’s iteration path.


  • TFS 2010 or higher
  • The Scrum process template
  • A @ProjectGUID  parameter – The GUID of the Team Project in which you’re interested


SELECT IterationPath
FROM dbo.CurrentWorkItemView
WHERE System_WorkItemType = ‘Sprint’
    AND ProjectNodeGUID = @ProjectGUID
    AND Microsoft_VSTS_Scheduling_StartDate <= GetDate()
    AND Microsoft_VSTS_Scheduling_FinishDate >= GetDate()

kick it on

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>