Create Item action discards when stat codes are in field mapping but not incoming MARC file

Description

Overview: When running a job that has a field mapping for statistical codes in the item record, the mapped field/subfield must be present in the incoming MARC record for the item record to be created. If the mapped field/subfield are not present, the item record is discarded and not created at all.

Current workaround: Using the UI, manually create each item record and populate all fields that were mapped

Steps to Reproduce:

  1. Log into Orchid Bugfest as diku_admin

  2. Load any .mrc file that uses the field mappings in this job (https://bugfest-orchid.int.aws.folio.org/settings/data-import/job-profiles/view/854d499b-5309-4dbc-b1ba-2e5ca7f4b1ea?query=LF%20-%20&sort=name)

    1. Some records should have a 949$s and some should not have a 949$s

    2. Make sure to use a unique barcode for each item

  3. Use job "LF - Testing adding statistical codes to items on create"

  4. Run the job

Expected Results: Instance, holdings, and item records would be created. For item records: If there was data in the 949$s, that statistical code would be populated. If there was no 949$s in the incoming MARC record, the mapped subfield would be ignored and no statistical code would be populated.

Actual Results: Instance, holdings, and items were created for those records that had a 949$s value. Records that did not include a 949$s were discarded and not created. This error message is given in the log: io.vertx.core.impl.NoStackTraceThrowable: {"errors":[{"message":"elements in list must match pattern","type":"1","code":"elements in list must match pattern","parameters":[{"key":"statisticalCodeIds","value":"[{}]"}]}]}

Additional Information: Orchid Bugfest Data Import job logs: https://bugfest-orchid.int.aws.folio.org/data-import/job-summary/86f6afca-c9b4-4bfb-b7fb-7b17cfcb54a6 ; https://bugfest-orchid.int.aws.folio.org/data-import/job-summary/f1a09f2c-f5c4-40a7-8ee0-7f2bb20e22d1 

Interested parties:  

 

BE notes:

  • Check approach with required property for the field statisticalCodeIds in the mapping profiles for Instance, Holdings, Items (see UIDATIMP-1384 for details, but note that it has a different structure than the notes objects)

  • If approach works - add migration script to populate mapping rule with "true" for "required" property for existing mapping profiles (Instance mapping profiles, Holdings mapping profiles, Item mapping profiles)

  • Add ticket for UI to populate that property when mapping profiles are created

UPD: this approach was checked and it turned out that it's not the case, so during the following investigation we found that the reason is empty value for statisticalCodeIds or value is statisticalCode name instead of ID when the name does not match ID.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Attachments

2

Checklist

hide

TestRail: Results

Activity

Show:

Ryan Taylor January 10, 2024 at 9:35 PM

Confirmed via that fix is looking good in snapshot. Moving ticket to done.

Maksym Ishchenko January 8, 2024 at 9:40 AM

Hello  

Ticket verified on snapshot env. Statistical codes mappes good. Moving ticket further

Screencast in attached FAT

cc:  

Yaroslav Kiriak December 15, 2023 at 4:05 PM
Edited

Fixed the first scenario when the value for statisticalCodeIds field is empty. For the second scenario (Statistical code name does not match ID) a separate ticket MODINV-940 will be created.

Ann-Marie Breaux October 23, 2023 at 10:49 AM
Edited

Check to see if also affecting Poppy release; if so, add Poppy; if not, decide if fix needed or not

Lynne Fors October 20, 2023 at 2:48 PM

 

Done

Details

Assignee

Reporter

Priority

Story Points

Sprint

Development Team

Folijet

Fix versions

Release

Quesnelia (R1 2024)

RCA Group

Incomplete/missing requirements

Affected releases

Poppy (R2 2023)
Orchid (R1 2023)

Affected Institution

!!!ALL!!!

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created October 20, 2023 at 2:47 PM
Updated March 18, 2024 at 6:36 PM
Resolved January 10, 2024 at 9:35 PM
TestRail: Cases
TestRail: Runs