Example #1
0
        public void Handle(BugUpdatedMessage message)
        {
            //TODO: take into account: when set the second developer in TP this developer assigned in Bugzilla

            if (!message.ChangedFields.Contains(BugField.EntityStateID))
            {
                return;
            }

            var bugzillaBug = _bugzillaInfoStorageRepository.GetBugzillaBug(message.Dto.ID);

            if (bugzillaBug == null)
            {
                return;
            }

            var status = _entityStateConverter.GetMappedBugzillaStatus(message.Dto);

            if (status == null)
            {
                return;
            }

            try
            {
                _log.InfoFormat("Updating bug status in Bugzilla. TargetProcess Bug ID: {0}; Bugzilla Bug ID: {1}", message.Dto.ID, bugzillaBug.Id);
                _bugzillaService.Execute(_actionFactory.GetChangeStatusAction(message.Dto, bugzillaBug.Id, status));
                _log.InfoFormat("Bug status in Bugzilla updated. TargetProcess Bug ID: {0}; Bugzilla Bug ID: {1}", message.Dto.ID, bugzillaBug.Id);
            }
            catch (Exception e)
            {
                _log.Error(e.Message, e);
            }
        }
        public IBugzillaAction GetCommentAction(CommentDTO comment, TimeSpan offset)
        {
            var bugzillaBug = _bugzillaStorage.GetBugzillaBug(comment.GeneralID);
            var owner       = GetOwner(comment);

            return(new BugzillaCommentAction(
                       bugzillaBug.Id,
                       comment.Description,
                       owner,
                       comment.CreateDate.GetValueOrDefault().ToUniversalTime().Add(offset)));
        }
Example #3
0
        private string GetDuplicateBugId(string resolution)
        {
            const string duplicate = "DUPLICATE";

            if (!duplicate.Equals(resolution, StringComparison.InvariantCultureIgnoreCase))
            {
                return(string.Empty);
            }

            var regex = new Regex("(D|d)(U|u)(P|p)(L|l)(I|i)(C|c)(A|a)(T|t)(E|e):\\s*#?(?<id>[0-9]+)",
                                  RegexOptions.Singleline | RegexOptions.IgnoreCase);
            var matches = regex.Matches(HttpUtility.HtmlDecode(_commentOnChangingState.ToLower()));

            int result;

            if (matches.Count <= 0 || !Int32.TryParse(matches[0].Groups["id"].Value, out result))
            {
                return(string.Empty);
            }

            var bugzillaBug = _bugzillaInfoStorageRepository.GetBugzillaBug(result);

            return(bugzillaBug != null ? bugzillaBug.Id : string.Empty);
        }
 protected override bool NeedToProcess(AttachmentDTO dto)
 {
     return(_bugzillaInfoStorageRepository.GetBugzillaBug(dto.GeneralID) != null);
 }
 private bool NeedToProcess(TeamDTO dto)
 {
     return(_bugzillaInfoStorageRepository.GetBugzillaBug(dto.AssignableID) != null);
 }
Example #6
0
 private bool NeedToProcess(CommentDTO dto)
 {
     return(!dto.Description.Equals(CommentConverter.StateIsChangedComment, StringComparison.InvariantCultureIgnoreCase) &&
            _bugzillaInfoStorageRepository.GetBugzillaBug(dto.GeneralID) != null);
 }