Commit Graph
2 Commits
Author SHA1 Message Date
Lauri Ojansivu 52a2ed7386 Make rule copies to another board durable when both boards opted into Sync effects.
A copyCard rule that copies onto another board now uses the same saved
command, with that board as its target: the copy takes that board's
labels of the same name, its custom fields as Card.copy maps them, its
card number and the dependencies that stay on it. Its checklists, items,
subtasks, comments and attachments are all placed on that board. As
with links, eligibility requires the destination to have opted in and
to have only durable rules of its own, and the runner checks it again.
The server test compares the result with the ordinary Card.copy to the
same board.

Thanks to xet7 !
2026-10-02 18:09:48 +03:00
Lauri Ojansivu 22311feaf4 Run the copyCard rule action through durable Sync on the card's own board.
A copyCard rule that copies onto the card's own board now has a saved
command. What the copy contains is decided once, with the ordinary
copy's own helpers: the card as Card.copy builds it (the custom fields
the actor may read, its dependencies on the board, its Scrum metadata,
a new card number, the bottom of the list), its live attachments, its
checklists and items, its subtasks with their checklists, and its
comments. Every document gets an id derived from the rule invocation,
so a replay inserts each once. The copy's and its subtasks' creation
activities are saved and delivered durably; each attachment file is
copied once (copyFile can now be given the id) and its History row is
written from the stored attachment; checklists, items and comments are
direct inserts, as Card.copy makes them. The cover is remapped to the
copied attachment by its derived id. Like the ordinary copy chain
guard, a copy whose own creation triggers the same action is not copied
again. A copy to another board keeps the board on direct Sync.

The server test copies a card with all of those, replays it, checks the
chain guard, and compares the result with the ordinary Card.copy.

Thanks to xet7 !
2026-10-02 17:09:16 +03:00