feat(triggers): support PM triggers for work items created directly in a triggering status#1141
Merged
zbigniewsobiecki merged 2 commits intodevfrom Apr 18, 2026
Merged
Conversation
…n a triggering status - Extend LinearStatusChangedTrigger.matches() to also match action: 'create' events - Extend JiraStatusChangedTrigger to match and handle jira:issue_created events - Update Linear and JIRA unit tests to cover creation scenarios Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
JIRA_EMAIL/JIRA_API_TOKEN/JIRA_BASE_URL were set in the CI/dev environment causing resolvePmType() to return 'jira' instead of 'trello' for tests that don't set CASCADE_PM_TYPE, leading to createPMProvider failing with "JIRA integration requires projectKey". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
zbigniewsobiecki
added a commit
that referenced
this pull request
Apr 18, 2026
Make the create-path firing (added by PR #1141) independently configurable per agent via the existing declarative YAML/CLI/dashboard pipeline. Two boolean params on pm:status-changed: - onMove (default true) — fire when an item is moved into the status - onCreate (default false) — fire when an item is created in the status Linear and JIRA: preserve pre-#1141 behavior by default; users opt in explicitly. Trello: data migration backfills onCreate=true for existing projects so fire-on-create keeps working without silent regression. Also tightens create-path matches() to require status presence, restores fromStatus in JIRA update-path log, de-dups the JIRA test helper's ternary, and extracts resolveAgentType/shouldFireOnEvent helpers to keep handler complexity in check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
zbigniewsobiecki
added a commit
that referenced
this pull request
Apr 18, 2026
Make the create-path firing (added by PR #1141) independently configurable per agent via the existing declarative YAML/CLI/dashboard pipeline. Two boolean params on pm:status-changed: - onMove (default true) — fire when an item is moved into the status - onCreate (default false) — fire when an item is created in the status Linear and JIRA: preserve pre-#1141 behavior by default; users opt in explicitly. Trello: data migration backfills onCreate=true for existing projects so fire-on-create keeps working without silent regression. Also tightens create-path matches() to require status presence, restores fromStatus in JIRA update-path log, de-dups the JIRA test helper's ternary, and extracts resolveAgentType/shouldFireOnEvent helpers to keep handler complexity in check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
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
LinearStatusChangedTrigger.matches()to also matchaction: 'create'events (issues created directly in a triggering Linear state)JiraStatusChangedTriggerto match and handlejira:issue_createdevents (reading status fromissue.fields.status.nameinstead of changelog)credential-scoping.test.tsfailures caused by JIRA env vars leaking into testscreateCardandupdateCard— no changes neededCard: https://trello.com/c/ysRpf882/612-support-pm-triggers-for-work-items-created-directly-in-a-triggering-status
Root Cause
Linear trigger checked
payload.action === 'update' && updatedFrom.stateId, and JIRA trigger checkedjira:issue_updated— neither matched when an issue was created directly in a triggering status. Trello's factory already hadisMove || isCreate.Changes
src/triggers/linear/status-changed.tsmatches()now also returnstrueforaction === 'create' && type === 'Issue'handle()is unchanged — already readsdata.stateIdanddata.identifierwhich are present on both create and update eventssrc/triggers/jira/status-changed.tsmatches()now also returnstrueforwebhookEvent === 'jira:issue_created'handle()delegates status resolution to a newresolveNewStatus()helper that reads fromissue.fields.status.namefor creation events and from changelog for update eventsTests
tests/unit/triggers/linear-status-changed.test.ts: Updated test that expectedaction: 'create'to NOT match; added 3 new tests for creation event handlingtests/unit/triggers/jira-status-changed.test.ts: Updated test that expectedjira:issue_createdto NOT match; addedissueStatusNamefixture support and 4 new tests for creation event handlingtests/unit/cli/credential-scoping.test.ts: Added cleanup ofJIRA_EMAIL/JIRA_API_TOKEN/JIRA_BASE_URLinbeforeEachso tests pass when these env vars are set in the environmentTest Plan
linear-status-changed.test.ts— 24 tests passjira-status-changed.test.ts— 25 tests passstatus-changed.test.ts(Trello) — 11 tests pass (no changes, already handled both cases)credential-scoping.test.ts— 8 tests pass (was 6 failing, now fixed)🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details