Example #1
0
        /// <summary>
        /// Gets the iteration details.
        /// </summary>
        /// <param name="iterationPath">The iteration path (including the project name, e.g. "TfsReporting\Sprint 3").</param>
        /// <returns></returns>
        public TfsIteration GetIteration(string iterationPath)
        {
            // you need to add the “Iteration” word after the team project name.
            // //Project Name\\Iteration\Iteration 1
            var projectNameIndex = iterationPath.IndexOf("\\", 2);
            var fullPath         = iterationPath.Insert(projectNameIndex, "\\Iteration");

            var css       = ProjectCollection.GetService <ICommonStructureService4>();
            var node      = css.GetNodeFromPath(fullPath);
            var iteration = new TfsIteration()
            {
                StartDate  = node.StartDate,
                FinishDate = node.FinishDate,
                Name       = node.Name,
                Path       = node.Path
            };

            return(iteration);
        }
        /// <summary>
        /// Gets the iteration details.
        /// </summary>
        /// <param name="iterationPath">The iteration path (including the project name, e.g. "TfsReporting\Sprint 3").</param>
        /// <returns></returns>
        public TfsIteration GetIteration(string iterationPath)
        {
            // you need to add the “Iteration” word after the team project name.
            // //Project Name\\Iteration\Iteration 1
            var projectNameIndex = iterationPath.IndexOf("\\", 2);
            var fullPath = iterationPath.Insert(projectNameIndex, "\\Iteration");

            var css = ProjectCollection.GetService<ICommonStructureService4>();
            var node = css.GetNodeFromPath(fullPath);
            var iteration = new TfsIteration()
            {
                StartDate = node.StartDate,
                FinishDate = node.FinishDate,
                Name = node.Name,
                Path = node.Path
            };

            return iteration;
        }