fix(jira): emit card.created so card creation syncs to Jira
handleCreateCard only published board.invalidated, which is not in the module event filter, so the dispatcher dropped it and jiraHandler.create never ran. Newly created cards therefore never produced a Jira issue, unlike moves (card.moved) and chat (message.created) which already synced. Emit card.created after assignee/tags are applied so the synced issue carries them. board.invalidated is kept for the SPA refetch path. No loop risk (card.created fires only from the HTTP handler) and no double-create (board.invalidated stays out of the filter).
This commit is contained in:
@@ -203,6 +203,13 @@ func handleCreateCard(db *DB, hub *EventHub) http.HandlerFunc {
|
||||
serverError(w, err)
|
||||
return
|
||||
}
|
||||
// card.created drives outbound modules (Jira) to create the issue.
|
||||
// Emitted after assignee/tags are applied so the synced issue carries
|
||||
// them. board.invalidated stays for the SPA's refetch path.
|
||||
hub.PublishJSON("card.created", c.ID, "", map[string]string{
|
||||
"card_id": c.ID,
|
||||
"column_id": body.ColumnID,
|
||||
})
|
||||
publishInvalidated(hub, c.ID, body.ColumnID)
|
||||
infra.HTTPJSONResponse(w, http.StatusCreated, c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user