Generate a work item for every epic created
As part of the migration of epics to work items, we need to create an associated work-item of type epic for every legacy epic that is created. We should use issue_id
column on epics table to hold the association. The work item created should have the same following fields as the legacy epic after its creation:
- group_id - called namespace_id at issues table
- title
- description
- author_id
- updated_by_id
- last_edited_by_id
- last_edited_at
- created_at
- updated_at
- closed_by_id
- closed_at
- state_id
- confidential
!134920 (closed)
Implementation proposal -- When a legacy epic is created we open a transaction
- A work item is created inside the transaction
- Still in the transaction we take work item id and assign to legacy epic
issue_id
column - Save both objects
ps: If there is a failure when saving any of the objects then none should be created. The transaction should rollback.
Edited by Felipe Artur