Skip to content

fix(pm): preserve custom status mappings in Trello/JIRA lifecycle configs#1374

Merged
aaight merged 1 commit into
devfrom
feature/MNG-1065-preserve-custom-status-mappings
May 18, 2026
Merged

fix(pm): preserve custom status mappings in Trello/JIRA lifecycle configs#1374
aaight merged 1 commit into
devfrom
feature/MNG-1065-preserve-custom-status-mappings

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 18, 2026

Summary

TrelloIntegration.resolveLifecycleConfig and JiraIntegration.resolveLifecycleConfig previously listed only the built-in CASCADE stage keys (backlog / inProgress / inReview / done / merged for Trello, plus splitting / planning / todo for JIRA) when normalizing the project's PM config. Any custom workflow key configured on the Trello board's lists or JIRA project's statuses (e.g. `prd`, `story`, `phased-plan`) was silently dropped, leaving custom agent hooks (`moveOnPrepare`, `moveOnSuccess`) unable to resolve those destinations.

This PR aligns both providers with the Linear pattern (`LinearIntegration.resolveLifecycleConfig`, which already spreads the full `statuses` record), so custom status keys survive lifecycle config normalization.

Changes

  • `src/pm/trello/integration.ts` — `resolveLifecycleConfig` now returns `statuses: { ...(trelloConfig?.lists ?? {}) }`; existing label normalization is unchanged.
  • `src/pm/jira/integration.ts` — `resolveLifecycleConfig` now returns `statuses: { ...(jiraConfig?.statuses ?? {}) }`; the cascade-* label defaults remain.
  • Two existing assertions in `tests/unit/pm/lifecycle.test.ts` that expected the old "only the canonical 5 keys" behavior were rewritten to assert the new spread shape — including the `todo` key which Trello now correctly surfaces.
  • New tests (12 total) prove `prd`, `story`, and `phased-plan` keys survive normalization for both providers, and that `PMLifecycleManager` can use the provider-normalized config to resolve a custom `moveOnPrepare` / `moveOnSuccess` destination.

Acceptance criteria

  • `TrelloIntegration.resolveLifecycleConfig` spreads the full `trello.lists` mapping into `statuses`.
  • `JiraIntegration.resolveLifecycleConfig` spreads the full `jira.statuses` mapping into `statuses`.
  • Existing built-in status and label normalization behavior remains unchanged (regression assertions in `jira-integration.test.ts` and the updated mappings in `lifecycle.test.ts`).
  • Tests prove Trello preserves custom status keys such as `prd`, `story`, and `phased-plan` (`trello/integration.test.ts`).
  • Tests prove JIRA preserves custom status keys such as `prd`, `story`, and `phased-plan` (`jira/integration.test.ts`, `jira-integration.test.ts`).
  • Lifecycle movement tests cover custom `moveOnPrepare` / `moveOnSuccess` paths against provider-normalized config (`lifecycle.test.ts` — both Trello and JIRA paths).

Out of scope

No schema migration. No dashboard wizard changes. No trigger config saving changes. No webhook dispatch changes.

Test plan

  • `npx vitest run tests/unit/pm/trello/integration.test.ts tests/unit/pm/jira/integration.test.ts tests/unit/pm/jira-integration.test.ts tests/unit/pm/lifecycle.test.ts tests/unit/pm/lifecycle-config-shape.test.ts` — all 119 tests pass.
  • `npx vitest run tests/unit/pm` — all 781 PM unit tests pass.
  • `npx vitest run tests/unit` — all 9649 unit tests pass.
  • `npm run typecheck` — clean.
  • `npx biome check` on touched files — clean.

Linear: https://linear.app/issue/MNG-1065

🤖 Generated with Claude Code

🕵️ claude-code · claude-opus-4-7 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - verified the provider normalization now preserves arbitrary Trello/JIRA workflow keys, keeps existing label behavior intact, and the lifecycle manager consumes the normalized status map through the existing dynamic move hook path. CI is passing.

🕵️ codex · gpt-5.5 · run details

@aaight aaight merged commit 58108f9 into dev May 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants