Skip to content

feat(monday-import): sub-issue relationships and custom Linear statuses#16

Open
shannonwho wants to merge 1 commit into
mainfrom
feature/monday-import-subissues-and-statuses
Open

feat(monday-import): sub-issue relationships and custom Linear statuses#16
shannonwho wants to merge 1 commit into
mainfrom
feature/monday-import-subissues-and-statuses

Conversation

@shannonwho
Copy link
Copy Markdown
Collaborator

Summary

Adds two capabilities to the Monday importer, each tied to a use case the prior flow couldn't represent:

  • Use case 1 — parent/sub-issue relationships per item. Subitems are now imported as real Linear sub-issues (linked via parentId) when items are imported in parentIssue mode or in issue mode with subitems.enabled. A new fieldMappings.subitem block lets sub-issues carry their own field/status mapping distinct from their parents. Previously subitems were either ignored or flattened.
  • Use case 2 — issue/project statuses beyond what exists in Linear. Configs can declare customIssueStates and customProjectStatuses (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 — new customIssueStates, customProjectStatuses, and fieldMappings.subitem types.
  • src/linear/client.tsensureCustomIssueStates / ensureCustomProjectStatuses create-if-missing logic.
  • src/importer/monday-engine.ts — sub-issue creation via parentId; 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

  • Dry-run a Monday export with subitems in issue mode + subitems.enabled — verify sub-issues print under their parents.
  • Live import the same export — verify sub-issues appear under their parent in Linear with the correct parentId.
  • Run with customIssueStates containing a status not present in the target team — verify it's created and items map onto it.
  • Run with customProjectStatuses containing a new workspace status — verify it's created and projects map onto it.
  • Re-run the same import — verify status creation is idempotent (no duplicates).

🤖 Generated with Claude Code

…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>
Copy link
Copy Markdown

@linear-code linear-code Bot left a comment

Choose a reason for hiding this comment

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

Left some comments. The core logic is solid, but sub-issue creation failures are silently dropped from the import result, meaning result.success reports true and result.failures stays empty even when sub-issues fail to create in the new isParentIssue path.

Comment on lines +204 to +211
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}`);
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

1 participant