Example #1
0
        private void UpdateSelectedSubTask()
        {
            try
            {
                ClearPullRequests();

                if (dgvSubTasks.SelectedRows.Count > 0)
                {
                    DevWorkItemView workItem = dgvSubTasks.SelectedRows[0].DataBoundItem as DevWorkItemView;

                    DisplayPullRequests(workItem?.PullRequests);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler(ex);
            }
        }
Example #2
0
        private DevWorkItemView GetDevWorkItemView(JiraIssue jiraIssue, IEnumerable <GitHubPullRequest> pullRequests)
        {
            var workItem = new DevWorkItemView()
            {
                JiraKey     = jiraIssue.Key,
                JiraStatus  = jiraIssue.Status,
                AssignedTo  = jiraIssue.AssignedTo,
                Description = jiraIssue.Description,
                Developer   = jiraIssue.Developer,
                Parent      = jiraIssue.Parent,
                JiraType    = jiraIssue.Type,
            };

            workItem.Status = GetWorkItemStatus(jiraIssue, pullRequests);

            workItem.PullRequests = pullRequests.ToList();

            if (pullRequests.Count() == 1)
            {
                var pullRequest = pullRequests.First();

                workItem.PullRequestId     = pullRequest.Id;
                workItem.PullRequestNumber = pullRequest.Number;
                workItem.PullRequestStatus = pullRequest.Status;
                workItem.IsReadyForQA      = pullRequest.IsReadyForQA;
                workItem.IsPatch           = pullRequest.IsPatch;
                workItem.IsOnHold          = pullRequest.IsOnHold;
            }

            foreach (JiraIssue subTask in jiraIssue.SubTasks)
            {
                var subTaskPullRequest = _pullRequests.Where(p => p.JiraKey == subTask.Key);

                var subTaskWorkItem = GetDevWorkItemView(subTask, subTaskPullRequest);

                workItem.SubTasks.Add(subTaskWorkItem);
            }

            return(workItem);
        }