feat(monday-import): sub-issue relationships and custom Linear statuses#16
feat(monday-import): sub-issue relationships and custom Linear statuses#16shannonwho wants to merge 1 commit into
Conversation
…r statuses Adds two capabilities to the Monday importer to cover use cases the prior flow couldn't represent: 1. Parent/sub-issue relationships: when importing items as issues with subitems enabled (or in parentIssue mode), subitems are now created as real Linear sub-issues via parentId instead of being dropped. Adds a separate fieldMappings.subitem block so sub-issues can have their own field/status mapping distinct from their parents. 2. New issue and project statuses: configs can declare customIssueStates and customProjectStatuses; the importer ensures these exist in Linear (creating them if missing) before mapping items onto them, so Monday workflows with statuses not present in the target Linear team/workspace import cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| console.log(` ✓ Sub-issue: ${subCreated.identifier} - ${truncateDisplay(subitemName, 40)}`); | ||
| result.summary.issuesCreated++; | ||
| result.mapping[subitemName] = subCreated.id; | ||
| } catch (subError) { | ||
| const msg = subError instanceof Error ? subError.message : String(subError); | ||
| console.log(` ✗ Sub-issue failed: ${truncateDisplay(subitemName, 40)} — ${msg}`); | ||
| } | ||
| } |
There was a problem hiding this comment.
Sub-issue creation failures not tracked in result.failures or result.success
(High) When a sub-issue fails to create in the isParentIssue path, the catch block only logs to console and does not call result.failures.push(...) or increment result.summary.failed. This means result.success = result.failures.length === 0 (evaluated at line ~234) returns true even when sub-issues were silently dropped. Callers that check result.success or result.failures to decide whether to re-run or alert on failures will see a false all-green. The same gap exists in the pre-existing isProject subitem path, but the isParentIssue sub-issue loop is entirely new to this PR and should track failures consistently with the outer item loop.
Summary
Adds two capabilities to the Monday importer, each tied to a use case the prior flow couldn't represent:
parentId) when items are imported inparentIssuemode or inissuemode withsubitems.enabled. A newfieldMappings.subitemblock lets sub-issues carry their own field/status mapping distinct from their parents. Previously subitems were either ignored or flattened.customIssueStatesandcustomProjectStatuses(name + Linear state type + optional color). Before import, the client ensures each declared status exists in the target team/workspace, creating it if missing, so Monday workflows with bespoke statuses import cleanly instead of falling back to_default.Changes
src/config/schema.ts— newcustomIssueStates,customProjectStatuses, andfieldMappings.subitemtypes.src/linear/client.ts—ensureCustomIssueStates/ensureCustomProjectStatusescreate-if-missing logic.src/importer/monday-engine.ts— sub-issue creation viaparentId; subitem-specific field/status mapping.src/commands/run.ts— wires status provisioning into the run pipeline; clearer parent/sub-issue logging.src/commands/init.ts,README.md— config scaffolding and docs for the new options.Test plan
issuemode +subitems.enabled— verify sub-issues print under their parents.parentId.customIssueStatescontaining a status not present in the target team — verify it's created and items map onto it.customProjectStatusescontaining a new workspace status — verify it's created and projects map onto it.🤖 Generated with Claude Code