Uploaded image for project: 'mod-user-import'
  1. mod-user-import
  2. MODUIMP-76

mod-user-import not respecting updateOnlyPresentFields with custom fields or email address

    XMLWordPrintable

Details

    • Story
    • Status: Open (View Workflow)
    • P2
    • Resolution: Unresolved
    • None
    • None
    • CP: R3 2022 roadmap, CP: Roadmap backlog
    • Core: Platform
    • Nolana (R3 2022)
    • Duke
    • Lack of testing

    Description

      Overview:

      This has been tested on a Duke environment running Lotus, on folio-snapshot, and on folio-lotus.

      Mod-user-import has a supported attribute that can be included called "updateOnlyPresentFields" (https://github.com/folio-org/mod-user-import) – from readme -

      "This should be true if only the fields present in the import should be updated, e.g. if a user address was added in FOLIO but that type of address is not present in the imported data then the address will be preserved."

      This should mean that if a JSON file sent to /user-import includes
      "updateOnlyPresentFields": true

      that if the JSON record for the user does NOT include the field, it should not be overwritten.

      It appears that mod-user-import does not respect this flag for custom fields that are set on a record, and does not respect the flag for email address. I did not test additional fields.

      Steps to Reproduce issue with custom fields

      1. On the FOLIO environment where you are testing, set up a user with permission user-import.all and get the user API token.
      2. Set up a custom field on the user record with name "Patron Type" and at least one value named "Staff - Library". See JSON: moduimp-76-customfield.json
      3. Send the JSON body formatted for mod-user-import ( test-user-moduimp76.json ) to the environment with your user-import user.
      4. Log into the environment and view the user. Verify that all of the records included in the body of the POST request are on the user record.
      5. Edit the JSON body and remove the custom field.
      6. Send the POST again to your testing environment with the new JSON body.
      7. Log into the environment and view the user.

      Expected Results: The custom field value remains since it was not included in the JSON body.
      Actual Results: The custom field value has been removed.

      Steps to Reproduce issue with email address

      1. On the FOLIO environment where you are testing, set up a user with permission user-import.all and get the user API token.
      2. Set up a custom field on the user record with name "Patron Type" and at least one value named "Staff - Library". See JSON: moduimp-76-customfield.json
      3. Send the JSON body formatted for mod-user-import ( test-user-moduimp76.json ) to the environment with your user-import user.
      4. Log into the environment and view the user. Verify that all of the records included in the body of the POST request are on the user record.
      5. Edit the JSON body and remove the email address.
      6. Send the POST again to your testing environment with the new JSON body.
      7. Log into the environment and view the user.

      Expected Results: The email address remains.
      Actual Results: The email address has been blanked out.

      Additional Information:
      URL:
      Interested parties:

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                enettifee Erin Nettifee
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:

                  TestRail: Runs

                    TestRail: Cases