I have two content types: Content A and Content B
Content A and Content B both have a field called field_code
Content A has a Entity reference type field called field_content with the following settings: Reference type: Content, Content type: content_b
I want to populate Content A field_content with content B when content A and Content B field_code are an exact match.
I can do this in the UI by searching searching for the field_code which is in part of Content B title.
As I have more than 500 content items to do I would like to do this automatically, I have looked at doing is via a custom module, node_presave, migrate yaml files and a preprocess function in my custom theme.
Note: Content B has been generate by a migrate yaml file