コード例 #1
0
        /// <summary>
        /// Populates migrationContext.TargetAreaAndIterationTree, migrationContext.TargetAreaPaths, and migrationContext.TargetIterationPaths
        /// </summary>
        /// <param name="migrationContext"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        public static async Task ReadTargetNodes(IMigrationContext migrationContext, string projectId)
        {
            var nodes = await WorkItemTrackingHelpers.GetClassificationNodes(migrationContext.TargetClient.WorkItemTrackingHttpClient, projectId);

            migrationContext.TargetAreaAndIterationTree = new AreaAndIterationPathTree(nodes);
            migrationContext.TargetAreaPaths            = migrationContext.TargetAreaAndIterationTree.AreaPathList;
            migrationContext.TargetIterationPaths       = migrationContext.TargetAreaAndIterationTree.IterationPathList;
        }
コード例 #2
0
        public async Task Prepare(IValidationContext context)
        {
            context.RequestedFields.Add(FieldNames.AreaPath);
            context.RequestedFields.Add(FieldNames.IterationPath);

            Logger.LogInformation("Reading the area and iteration paths from the source and target accounts");

            try
            {
                var classificationNodes = await WorkItemTrackingHelpers.GetClassificationNodes(context.TargetClient.WorkItemTrackingHttpClient, context.Config.TargetConnection.Project);

                var nodes = new AreaAndIterationPathTree(classificationNodes);
                context.TargetAreaPaths      = nodes.AreaPathList;
                context.TargetIterationPaths = nodes.IterationPathList;
            }
            catch (Exception e)
            {
                throw new ValidationException("Unable to read the classification nodes on the source", e);
            }
        }
コード例 #3
0
        /// <summary>
        /// Populates migrationContext.SourceAreaAndIterationTree
        /// </summary>
        /// <param name="migrationContext"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        public static async Task ReadSourceNodes(IMigrationContext migrationContext, string projectId)
        {
            var nodes = await WorkItemTrackingHelpers.GetClassificationNodes(migrationContext.SourceClient.WorkItemTrackingHttpClient, projectId);

            migrationContext.SourceAreaAndIterationTree = new AreaAndIterationPathTree(nodes);
        }