public static void CopyFieldValues(
            [NotNull] Item sourceIntegrationItem,
            [NotNull] SharepointBaseItem targetSharepointItem,
            [NotNull] IntegrationConfigData integrationConfigData)
        {
            Assert.ArgumentNotNull(sourceIntegrationItem, "sourceIntegrationItem");
            Assert.ArgumentNotNull(targetSharepointItem, "targetSharepointItem");
            Assert.ArgumentNotNull(integrationConfigData, "integrationConfigData");

            foreach (IntegrationConfigData.FieldMapping fieldMapping in integrationConfigData.FieldMappings)
            {
                if (sourceIntegrationItem.Fields[fieldMapping.Target] == null)
                {
                    continue;
                }

                TranslateIntegrationValueArgs pipelineArgs = TranslateSynchValuePipelinesRunner.TranslateIntegrationValue(
                    sourceIntegrationItem,
                    fieldMapping.Target,
                    targetSharepointItem,
                    fieldMapping.Source);
                if (pipelineArgs != null && !(String.IsNullOrEmpty(targetSharepointItem[fieldMapping.Source]) && String.IsNullOrEmpty(pipelineArgs.TranslatedValue)))
                {
                    targetSharepointItem[fieldMapping.Source] = pipelineArgs.TranslatedValue;
                }
            }
        }
        /// <summary>
        /// Update fields of integration item in CMS from SharePoint.
        /// </summary>
        /// <param name="targetIntegrationItem">The item.</param>
        /// <param name="sourceSharepointItem">The source.</param>
        /// <param name="synchContext">The synchronization context.</param>
        public static void UpdateFields([NotNull] Item targetIntegrationItem, [NotNull] SharepointBaseItem sourceSharepointItem, [NotNull] SynchContext synchContext)
        {
            Assert.ArgumentNotNull(targetIntegrationItem, "targetIntegrationItem");
            Assert.ArgumentNotNull(sourceSharepointItem, "sourceSharepointItem");
            Assert.ArgumentNotNull(synchContext, "synchContext");

            var folderItem = sourceSharepointItem as FolderItem;

            if (folderItem != null)
            {
                UpdateIntegrationConfigData(targetIntegrationItem, folderItem, synchContext);
            }

            using (new EditContext(targetIntegrationItem))
            {
                if (string.IsNullOrEmpty(targetIntegrationItem.Fields[FieldNames.GUID].Value))
                {
                    if (targetIntegrationItem.Template.GetField(SharepointFieldIDs.IsIntegrationItem) != null)
                    {
                        new CheckboxField(targetIntegrationItem.Fields[SharepointFieldIDs.IsIntegrationItem]).Checked = true;
                    }
                }

                targetIntegrationItem.Fields[FieldNames.GUID].Value = sourceSharepointItem.GUID;

                foreach (IntegrationConfigData.FieldMapping mapping in synchContext.IntegrationConfigData.FieldMappings)
                {
                    if (targetIntegrationItem.Fields[mapping.Target] != null)
                    {
                        TranslateSharepointValueArgs pipelineArgs = TranslateSynchValuePipelinesRunner.TranslateSharepointValue(sourceSharepointItem, mapping.Source, targetIntegrationItem, mapping.Target);
                        if (pipelineArgs != null)
                        {
                            targetIntegrationItem[mapping.Target] = pipelineArgs.TranslatedValue;
                        }
                    }
                }
            }
        }