public void Handle(ExistingBugImportedToTargetProcessMessage <BugzillaBug> message)
        {
            var newAttachments =
                message.ThirdPartyBug.attachmentCollection.Where(attachment => !AttachmentExists(message, attachment)).ToList();

            AttachmentFolder.Delete(message.ThirdPartyBug.attachmentCollection.Except(newAttachments).Select(x => x.FileId));

            PushAttachmentsToTp(message.TpBugId, message.ThirdPartyBug, newAttachments);
        }
示例#2
0
        public void Handle(ExistingBugImportedToTargetProcessMessage <BugzillaBug> message)
        {
            var role = _storageRepository.GetProfile <BugzillaProfile>().GetAssigneeRole();

            UnassignUsersInTargetProcess(role.Name, message.TpBugId);
            AssignDeveloperToBug(message.TpBugId, message.ThirdPartyBug);

            CompleteIfNecessary();
        }
示例#3
0
        public void Handle(ExistingBugImportedToTargetProcessMessage <BugzillaBug> message)
        {
            var newComments =
                message.ThirdPartyBug.comments
                .Where(comment => !CommentExists(message, comment))
                .Reverse()
                .ToList();

            if (newComments.Any())
            {
                _logger.InfoFormat("Importing {1} comment(s) for bug. {0}", message.ThirdPartyBug.ToString(), newComments.Count);
            }

            CreateComments(newComments, message.TpBugId);
        }
 private bool AttachmentExists(ExistingBugImportedToTargetProcessMessage <BugzillaBug> message,
                               LocalStoredAttachment attachment)
 {
     return(_storageRepository.Get <AttachmentDTO>()
            .Any(c => c.GeneralID == message.TpBugId && c.CreateDate == attachment.CreateDate));
 }
示例#5
0
 private bool CommentExists(ExistingBugImportedToTargetProcessMessage <BugzillaBug> message, BugzillaComment comment)
 {
     return(StorageRepository().Get <CommentDTO>(message.TpBugId.ToString())
            .Any(c => c.CreateDate.Value.ToUniversalTime() == CreateDateConverter.ParseToUniversalTime(comment.DateAdded)));
 }