Example #1
0
        public TestPlanMigration(TfsProject sourceTfs, TfsProject targetTfs)
        {
            this.sourceproj      = GetProject(sourceTfs.collection, sourceTfs.project.Name);
            this.destinationproj = GetProject(targetTfs.collection, targetTfs.project.Name);

            projectName = sourceTfs.project.Name;
        }
        public WorkItemMigration(TfsProject sourceProject, TfsProject targetProject)
        {
            this.sourceProject = sourceProject;
            this.targetProject = targetProject;

            sourceWorkItemStore = (WorkItemStore)sourceProject.collection.GetService(typeof(WorkItemStore));
            targetWorkItemStore = (WorkItemStore)targetProject.collection.GetService(typeof(WorkItemStore));
        }
Example #3
0
        private void ConnectDestinationProjectButton_Click()
        {
            TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);

            System.Windows.Forms.DialogResult result = tpp.ShowDialog();
            if (result == System.Windows.Forms.DialogResult.OK)
            {
                TargetProject = new TfsProject(tpp.SelectedTeamProjectCollection, tpp.SelectedProjects[0].Name);
                RaisePropertyChanged("TargetProject");

                FieldMapping.Refresh();
                UserMapping.Refresh();
            }
        }
        public WorkItemCollection GetWorkItems(TfsProject project, bool IsNotIncludeClosed, bool IsNotIncludeRemoved)
        {
            string query = "";

            if (IsNotIncludeClosed && IsNotIncludeRemoved)
            {
                query = string.Format(" SELECT * " +
                                      " FROM WorkItems " +
                                      " WHERE [System.TeamProject] = '" + project.project.Name +
                                      "' AND [System.State] <> 'Closed' AND [System.State] <> 'Removed' ORDER BY [System.Id]");
            }
            else if (IsNotIncludeRemoved)
            {
                query = string.Format(" SELECT * " +
                                      " FROM WorkItems " +
                                      " WHERE [System.TeamProject] = '" + project.project.Name +
                                      "' AND [System.State] <> 'Removed' ORDER BY [System.Id]");
            }
            else if (IsNotIncludeClosed)
            {
                query = string.Format(" SELECT * " +
                                      " FROM WorkItems " +
                                      " WHERE [System.TeamProject] = '" + project.project.Name +
                                      "' AND [System.State] <> 'Closed'  ORDER BY [System.Id]");
            }
            else
            {
                query = string.Format(" SELECT * " +
                                      " FROM WorkItems " +
                                      " WHERE [System.TeamProject] = '" + project.project.Name +
                                      "' ORDER BY [System.Id]");
            }

            System.Diagnostics.Debug.WriteLine(query);

            WorkItemCollection workItemCollection = sourceWorkItemStore.Query(query);

            return(workItemCollection);
        }