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

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:

  1. Send the JSON body formatted for mod-user-import (

  1. ) to the environment with your user-import user.

  2. 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.

  3. Edit the JSON body and remove the custom field.

  4. Send the POST again to your testing environment with the new JSON body.

  5. 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:

  1. Send the JSON body formatted for mod-user-import (

  1. ) to the environment with your user-import user.

  2. 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.

  3. Edit the JSON body and remove the email address.

  4. Send the POST again to your testing environment with the new JSON body.

  5. 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:

Environment

None

Potential Workaround

None

Attachments

2
  • 10 Aug 2022, 07:28 PM
  • 10 Aug 2022, 07:15 PM

Checklist

hide

TestRail: Results

Activity

Show:

Julian Ladisch March 17, 2023 at 8:40 AM

Khalilah Gambrell March 16, 2023 at 11:24 PM

Hey and was this issue addressed for Nolana?

Brooks Travis September 20, 2022 at 5:34 PM

 I would argue that this is functionality not behaving as documented, and should be a bug. It's also related to this VERY OLD open issue: https://folio-org.atlassian.net/browse/MODUIMP-8#icft=MODUIMP-8

Julian Ladisch September 19, 2022 at 3:23 PM

updateOnlyPresentFields is implemented for addresses only:
https://github.com/folio-org/mod-user-import/blob/v3.6.6/src/main/java/org/folio/service/UserDataProcessingService.java#L93-L96

Therefore I convert this feature request to a story.

Charlotte Whitt September 19, 2022 at 2:21 PM

Support Sig: or please add the release target?

Details

Assignee

Reporter

Priority

Development Team

Core: Platform

Affected Institution

Duke

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created August 10, 2022 at 7:01 PM
Updated June 12, 2023 at 5:45 PM
TestRail: Cases
TestRail: Runs