Programmatic import not working when specifying TM fields

I am trying to import an SDL XLIFF file into a file TM that has the TM fields Status (single value list field) and Project (multiple string text field) defined. The import works fine without adding any field values in the import settings.

 

When I add only the Project field (and not the Status field), then the import is done, but the field values are not added. When I add the Status field, the import is not done, i.e. the TM stays empty.

Any ideas?      

 private void DoImport()

        {

            FileBasedTranslationMemory tm = new FileBasedTranslationMemory(@"c:\test\test.sdltm");

            TranslationMemoryImporter import = new TranslationMemoryImporter(tm.LanguageDirection);

            import.ImportSettings.ProjectSettings = GetProjectSettings();         

            import.ImportSettings = GetImportSettings();

            import.Import(@"c:\test\test.sdlxliff");

            Application.Exit();

        }

 

        private ImportSettings GetImportSettings()

        {

            ImportSettings settings = new ImportSettings();

                return settings;

        }

 

        private FieldValues GetProjectSettings()

        {

            FieldValues _fieldValues = new FieldValues();

            SinglePicklistFieldValue _status = new SinglePicklistFieldValue("Status");

            _status.Add("Approved");

            MultipleStringFieldValue _project = new MultipleStringFieldValue("Project");

            _status.Add("12345");

            _fieldValues.Add(_status); // when this field is added, TM stays empty after import

            _fieldValues.Add(_project); // when this field is added (i.e. only Project, not Status), then the units are imported, but without field values

            return _fieldValues;

        }