protected void SetFieldFromMapping(string value, ConvertedBug convertedBug)
        {
            var mappedValue = Map[value];

            if (mappedValue.Id != 0)
            {
                SetValue(convertedBug, mappedValue.Id);
                convertedBug.ChangedFields.Add(BugField);
                _logger.InfoFormat("{0} mapped. Bug: {1}; Value: {2}", BugFieldName, convertedBug.BugDto.Name, value);
            }
        }
        protected void SetFieldFromStorage(string value, ConvertedBug convertedBug)
        {
            var state = GetFromStorage(value);

            if (state != null)
            {
                SetValue(convertedBug, state.ID.GetValueOrDefault());
                convertedBug.ChangedFields.Add(BugField);
                _logger.InfoFormat("{0} guessed. Bug: {1}; Value: {2}", BugFieldName, convertedBug.BugDto.Name, value);
            }
        }
        public void Apply(BugzillaBug thirdPartyBug, ConvertedBug convertedBug)
        {
            var description = thirdPartyBug.description;

            if (String.IsNullOrEmpty(description))
            {
                return;
            }

            convertedBug.BugDto.Description = FormatDescription(description);
            convertedBug.ChangedFields.Add(BugField.Description);
        }
        public void Apply(BugzillaBug thirdPartyBug, ConvertedBug convertedBug)
        {
            //<= CurrentDate.Value ? dateTime : CurrentDate.Value;
            var dateTime = ParseFromBugzillaLocalTime(thirdPartyBug.creation_ts);
            var now      = CurrentDate.Value;

            if (dateTime > now)
            {
                dateTime = now;
            }

            convertedBug.BugDto.CreateDate = dateTime;
        }
        public void Apply(BugzillaBug bugzillaBug, ConvertedBug convertedBug)
        {
            var bugName = bugzillaBug.short_desc;

            if (bugName.Length > 255)
            {
                _logger.WarnFormat("Bug {0} name was shortened to 255 characters", Int32.Parse(bugzillaBug.bug_id));
                bugName = bugName.Remove(255);
            }

            convertedBug.ChangedFields.Add(BugField.Name);
            convertedBug.BugDto.Name = bugName;
        }
        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);
            }
        }
 public void Apply(BugzillaBug thirdPartyBug, ConvertedBug convertedBug)
 {
     convertedBug.BugDto.CommentOnChangingState = StateIsChangedComment;
 }
 protected abstract void SetValue(ConvertedBug convertedBug, int id);
 public void Apply(BugzillaBug bugzillaBug, ConvertedBug convertedBug)
 {
     convertedBug.BugDto.OwnerID = _userMapper.GetTpIdBy(bugzillaBug.reporter);
 }
 protected override void SetValue(ConvertedBug dto, int id)
 {
     dto.BugDto.EntityStateID = id;
 }
Example #11
0
 protected override void SetValue(ConvertedBug dto, int id)
 {
     dto.BugDto.PriorityID = id;
 }