Exemple #1
0
        private void RecoverTicketCustomValues(int orgID, int badTicketID, int goodTicketID)
        {
            CustomValues badCustomValues = new CustomValues(GetCorrupteLoginUser());

            badCustomValues.LoadByReferenceTypeModifiedAfterRecovery(orgID, ReferenceType.Tickets, badTicketID);

            foreach (CustomValue badCustomValue in badCustomValues)
            {
                try
                {
                    if (badCustomValue == null)
                    {
                        continue;
                    }
                    CustomValue goodCustomValue = CustomValues.GetValue(GetReviewLoginUser(), goodTicketID, badCustomValue.ApiFieldName);
                    if (goodCustomValue != null)
                    {
                        goodCustomValue.Value = badCustomValue.Value;
                        goodCustomValue.Collection.Save();
                    }
                }
                catch (Exception ex)
                {
                    _exceptionOcurred = true;
                    ExceptionLogs.LogException(GetCorrupteLoginUser(), ex, "recover");
                }
            }
        }