public void SyncProject() { Microsoft.Office.Interop.MSProject.Project project = Globals.ThisAddIn.Application.ActiveProject; var selectedProjectNames = Properties.Settings.Default.SelectedProjects; var projects = JsonConvert.DeserializeObject <IEnumerable <Project> >(Properties.Settings.Default.Projects); var selectedProjects = (from p in projects where selectedProjectNames.Contains(p.Name) select p).ToList(); foreach (var selectedProject in selectedProjects) { Microsoft.Office.Interop.MSProject.Task newProjectTask = project.Tasks.Add(selectedProject.Name); newProjectTask.WBS = selectedProject.Key; if (newProjectTask.OutlineLevel == 2) { newProjectTask.OutlineOutdent(); } var issues = (from i in _jira.Issues.Queryable where i.Status != "Done" && i.Project == selectedProject.Key orderby i.Created select i).Take(100); var isIndented = false; foreach (var issue in issues) { Microsoft.Office.Interop.MSProject.Task newTask = project.Tasks.Add(issue.Summary); newTask.WBS = issue.Key.ToString(); if (issue.TimeTrackingData.OriginalEstimate != null) { newTask.Duration = issue.TimeTrackingData.OriginalEstimate.Split(' ')[0]; } newTask.ResourceNames = issue.Assignee; if (!isIndented) { newTask.OutlineIndent(); isIndented = true; } //newTask.Priority = issue.Priority; } } }
private void SyncProjectToJira(Microsoft.Office.Interop.MSProject.Project project, Jira jira) { foreach (Microsoft.Office.Interop.MSProject.Task task in project.Tasks) { if (task.OutlineLevel != 1) { if (task.WBS == "") { //create task } else { var issue = jira.CreateIssue(task.Name); issue.Type = "Story"; issue.Priority = "Medium"; issue.Summary = task.Summary; issue.Assignee = task.ResourceNames; var issueResult = issue.SaveChangesAsync().Result; task.WBS = issueResult.Key.ToString(); } } } }
void _ProjectApplication_NewProject(Microsoft.Office.Interop.MSProject.Project pj) { DisplayInWatchWindow(NewProject++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void _ProjectApplication_ProjectAssignmentNew(Microsoft.Office.Interop.MSProject.Project pj, int ID) { DisplayInWatchWindow(ProjectAssignmentNew++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void _ProjectApplication_ProjectBeforeClearBaseline(Microsoft.Office.Interop.MSProject.Project pj, bool Interim, Microsoft.Office.Interop.MSProject.PjBaselines bl, Microsoft.Office.Interop.MSProject.PjSaveBaselineTo InterimFrom, bool AllTasks, Microsoft.Office.Interop.MSProject.EventInfo Info) { DisplayInWatchWindow(ProjectBeforeClearBaseline++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void _ProjectApplication_ProjectBeforeClose2(Microsoft.Office.Interop.MSProject.Project pj, Microsoft.Office.Interop.MSProject.EventInfo Info) { DisplayInWatchWindow(ProjectBeforeClose2++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void _ProjectApplication_ProjectBeforeClose(Microsoft.Office.Interop.MSProject.Project pj, ref bool Cancel) { DisplayInWatchWindow(ProjectBeforeClose++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }
void _ProjectApplication_ProjectBeforeSaveBaseline(Microsoft.Office.Interop.MSProject.Project pj, bool Interim, Microsoft.Office.Interop.MSProject.PjBaselines bl, Microsoft.Office.Interop.MSProject.PjSaveBaselineFrom InterimCopy, Microsoft.Office.Interop.MSProject.PjSaveBaselineTo InterimInto, bool AllTasks, bool RollupToSummaryTasks, bool RollupFromSubtasks, Microsoft.Office.Interop.MSProject.EventInfo Info) { DisplayInWatchWindow(ProjectBeforeSaveBaseline++, System.Reflection.MethodInfo.GetCurrentMethod().Name); }