Appian version 23.3 Write Record Smart service error out when saving one to one relationship id

Certified Senior Developer

I have a one to one relationship between WorkItem and Lead where workitemId is a foreign key in Lead. I first create workitem and then pass its id to lead while creating lead. Conditions in table, workitemId is unique and not null. This has been working fine in previous version of Write Record Smart service but in new version it is not working and giving error for workItemId not being there.

Lead: {leadId=505, workItemId=2843, qualityScore=4} This gives error: Unable to write to the source due to system error. Error Details: Field 'work_item_id' doesn't have a default value. Note: Same input still works with old version of write record smart service.

In logs I see it creates prepared statement without workitemId field: 

Caused by: org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO `PRO_Lead` (`quality_score`, `lead_id`) VALUES (?, ?)]; Field 'work_item_id' doesn't have a default value; nested exception is java.sql.SQLException: Field 'work_item_id' doesn't have a default value

  Discussion posts and replies are publicly visible