Skip to content

pac data import incorrectly updates a record instead of creating a new record #1200

@erezyaron

Description

@erezyaron

During import the tool will switch from insert to update incorrectly on a record when the GUID is not found but the name matches, resulting in an update to the incorrect record.
I have multiple records, 3 contain the same "name" and are different in other fields on the entity. The tool will show in the verbose logs that the file contains 16 records, the record query on the target environment returns 15 records. During preprocess it shows something like the following for ALL records:
Switching Insert to Update ( Matched on Source ID )

with the following detail showing up twice, for two separate records:
xxxx_name = Send to Analyst, Matched to ID: 822efe89-2377-ef11-a671-001dd806b464

This results in 15 records remaining on the target environment instead, with an incorrect update to a single record.

To Reproduce
Steps to reproduce the behavior:

  1. Export multiple records from a source entity
  2. Import those records to a target environment
  3. Create one new record in the source environment with an existing name as a duplicate (other fields can be different)
  4. Export those records - verify the resulting XML contains those two records with different record id values
  5. Import those records to the same target environment

Expected behavior
The new record should appear in the target environment, with the new GUID but the same name.

Actual behavior
The new record is not created, and there is incorrect update made to the first record matching by name instead of record id.

extra notes
This was first observed in an ALM pipeline deployment, which does not have the verbose flag option.
Running this on a windows machine with the -v flag shows the logs with PreProcess record count query from target, compared to Processing query count from source file, as well as Switching Insert to Update messages, and final Import 16 of 16 message complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions