Example #1
0
        private void AssignDeveloperToBug(int?tpBugId, BugzillaBug bugzillaBug)
        {
            var role     = _storageRepository.GetProfile <BugzillaProfile>().GetAssigneeRole();
            var tpUserId = _userMapper.GetTpIdBy(bugzillaBug.assigned_to);

            AssignUserToBug(tpBugId, tpUserId, role);
        }
Example #2
0
        private void AssignQAToBug(int?tpBugId, BugzillaBug bugzillaBug)
        {
            var role     = _storageRepository.GetProfile <BugzillaProfile>().GetReporterRole();
            var tpUserId = _userMapper.GetTpIdBy(bugzillaBug.reporter);

            AssignUserToBug(tpBugId, tpUserId, role);
        }
Example #3
0
        private async Task SetBugDisplay()
        {
            _bug = null;
            while (true)
            {
                try
                {
                    StartProgressBar();
                    InitializeCancellation();
                    UpdateStatus(GetReviewButtonText());

                    await Task.Delay(1500, _getBugCancellation.Token);

                    _bug = await GetBugInformationAsync();

                    UpdateBugFields();
                    return;
                }
                catch (Exception ex)
                {
                    _bug = null;

                    checkBoxUpdateOnlyBugzilla.Checked = false;
                    ToggleBugzillaVisibility(false);

                    if (ex is TaskCanceledException)
                    {
                        UpdateStatus(GetReviewButtonText(), true);
                        return;
                    }

                    Console.WriteLine(ex);

                    if (!(ex is BugzillaAuthenticationException))
                    {
                        MessageBox.Show(this, "Could not get bug status. See log for more information.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        UpdateStatus(GetReviewButtonText(), true);
                        return;
                    }

                    UpdateStatus("Authentication failed");
                }
                finally
                {
                    StopProgressBar();
                }

                await Task.Delay(1500);
            }
        }
        public void Apply(BugzillaBug bugzillaBug, ConvertedBug convertedBug)
        {
            var value = GetBugzillaValue(bugzillaBug);

            if (string.IsNullOrEmpty(value))
            {
                return;
            }

            if (Map != null && Map[value] != null)
            {
                SetFieldFromMapping(value, convertedBug);
            }
            else
            {
                SetFieldFromStorage(value, convertedBug);
            }

            if (!convertedBug.ChangedFields.Contains(BugField))
            {
                _logger.ErrorFormat("{0} mapping failed. {1}; Value: {2}", BugFieldName, bugzillaBug.ToString(), value);
            }
        }
 protected abstract string GetBugzillaValue(BugzillaBug bugzillaBug);