feat(jira): route custom mapped statuses through workflow-definition resolvers#1373
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
approved these changes
May 18, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - The Jira status-change and ready-label paths now resolve matched status names through workflow definitions while preserving built-in mappings, case-insensitive Jira matching, and create/move gating. Targeted unit coverage passes locally: 81 tests across the changed resolver and Jira trigger files.
🕵️ codex · gpt-5.5 · run details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Routes JIRA status-change and ready-to-process-label webhooks through the workflow-definition resolver so that custom-mapped JIRA statuses can dispatch their configured agents. Mirrors Linear's existing pattern but uses case-insensitive name matching since JIRA's
statuses.<key>config values are display names, not stable IDs.Closes MNG-1066.
What changed
src/triggers/shared/pm-status.ts— AddedresolvePMStatusAgentByNameFromWorkflowDefinitions({ statusName, configuredStatuses }), the case-insensitive name-based counterpart of the existingresolvePMStatusAgentByIdFromWorkflowDefinitions. Returns{ agentType, cascadeStatus }resolved throughresolveWorkflowStatusDefinitionso built-in and custom workflow status keys both dispatch correctly.src/triggers/shared/pm-label.ts— AddedresolvePMLabelAgentByStatusNameFromWorkflowDefinitions({ statusName, configuredStatuses })that returns{ agentType, cascadeStatus }via the workflow-definition path. The legacyresolvePMLabelAgentByStatusName(returns justagentType) is kept exported for current callers.src/triggers/jira/status-changed.ts— Switched from the legacy hard-codedSTATUS_TO_AGENTresolver to the new workflow-definition resolver. JIRA custom statuses likestatuses.prd: "PRD Review"now dispatch their configured agent type. AddscascadeStatusto the info log for parity with Linear.src/triggers/jira/label-added.ts— Same change for the ready-to-process label trigger: when the configured ready label is added to an issue currently in a custom status, the agent registered on that workflow definition fires.The legacy helpers
resolvePMStatusAgentByName,resolvePMStatusAgentById,resolvePMLabelAgentByStatusName, andresolvePMLabelAgentByStatusIdremain exported so other call sites (and existing tests) keep working unchanged.Test plan
tests/unit/triggers/shared/pm-status.test.ts— new cases for custom-status resolution, built-in name resolution, status without agent, no-match returning undefined.tests/unit/triggers/shared/pm-label.test.ts— new cases for the JIRA name-based workflow-definition resolver (built-in, custom, no-agent) and for the existing ID-based resolver (Linear).tests/unit/triggers/jira-status-changed.test.ts— newcustom workflow status mappingblock: custom dispatch, case-insensitive match, no-agent custom status, missing workflow definition, trigger enablement check, custom-status onCreate dispatch.tests/unit/triggers/jira-label-added.test.ts— newcustom workflow status mappingblock: custom dispatch, case-insensitive match, no-agent custom status, missing workflow definition, trigger enablement, disabled trigger.unit-triggers+unit-coresuites: 6834 tests pass).🕵️ claude-code · claude-opus-4-7 · run details