Skip to content

Feat: multi-team sync — sync multiple Linear teams into separate vault folders#8

Open
richardbowman wants to merge 1 commit into
casals:masterfrom
rbcodelabs:feat/multi-team-sync
Open

Feat: multi-team sync — sync multiple Linear teams into separate vault folders#8
richardbowman wants to merge 1 commit into
casals:masterfrom
rbcodelabs:feat/multi-team-sync

Conversation

@richardbowman

@richardbowman richardbowman commented May 9, 2026

Copy link
Copy Markdown

Closes #2

Problem

The plugin previously supported only a single Linear team synced into a single vault folder. Users working across multiple projects had to manually swap the default team setting and re-sync each time — making Obsidian impractical as a primary workspace for multi-project workflows.

Solution

This PR adds a teamSyncConfigs[] setting that lets users configure any number of Linear teams, each mapped to its own vault folder. A single Sync Linear Issues command syncs all enabled teams in one operation.

Example vault layout after sync:

Linear Issues/
  Golden Wealth/
    GW-1 - Insurance Policy Inventory.md
    GW-2 - Power of Attorney Builder.md
  Engineering/
    ENG-42 - Fix login bug.md
  Marketing/
    MKT-7 - Q3 campaign brief.md

Changes

src/models/types.ts

  • New TeamSyncConfig interface (teamId, teamName, teamKey, syncFolder, enabled)
  • Added teamSyncConfigs: TeamSyncConfig[] to LinearPluginSettings
  • Legacy teamId + syncFolder fields retained as fallback

src/sync/sync-manager.ts

  • syncAll() loops over enabled team configs, syncing each into its designated folder
  • Falls back to legacy single-team config when teamSyncConfigs is empty
  • Multi-team mode skips lastSyncTime filter so all issues are always fully present per folder
  • ensureSyncFolder() and findOrCreateNoteForIssue() now accept folder path as a parameter

src/ui/settings-tab.ts

  • New Team sync section showing all configured teams with per-row enable toggle and remove button
  • + Add team modal auto-loads available teams from the Linear API for easy selection
  • Legacy Default Team + Sync Folder settings shown only when no team configs are defined

main.ts

  • sync-linear-issues command now shows toast notifications: "Syncing..." on start, count summary on completion, and error count if anything fails

README.md

  • New Multi-team Sync section with setup steps and example folder layout
  • teamSyncConfigs added to the settings reference table

Backward Compatibility & Migration

No action required for existing users: If teamSyncConfigs is empty (the default), the plugin falls back to the legacy teamId + syncFolder behavior with no change in behavior.

Migrating to multi-team sync: When a user adds team sync configs, new notes are created in the configured subfolder. However, findOrCreateNoteForIssue only searches within the new team folder — so existing notes in the old flat folder will not be found and duplicates will be created. Users migrating from single-team to multi-team should either:

  1. Manually move their existing notes into the new subfolder before running sync, OR
  2. Delete the old notes after verifying the new copies are correct

A future improvement could be a one-time migration helper that moves existing Linear notes into the appropriate team subfolder automatically. Happy to add that if the maintainer considers it a blocker.

Testing

Tested with 2 teams (Golden Wealth + RB Code Labs) syncing 35 and 4 issues respectively into separate vault folders. Verified:

  • Issues create as individual .md notes with correct frontmatter
  • Re-sync updates existing notes without clobbering user-edited content
  • Enable/disable toggle per team works correctly
  • Removing a team config works correctly
  • Legacy single-team mode unaffected

🤖 Generated with Claude Code

…t folders

Closes casals#2

Previously the plugin could only sync a single Linear team into a single
vault folder, requiring users to manually switch the default team to work
across projects.

This change adds a TeamSyncConfig[] setting that lets users configure any
number of Linear teams, each mapped to its own vault folder. Syncing runs
a full pull for every enabled team in one operation.

Changes:
- types.ts: Add TeamSyncConfig interface; add teamSyncConfigs[] to
  LinearPluginSettings with backward-compatible legacy teamId/syncFolder
  fallback
- sync-manager.ts: syncAll() loops over teamSyncConfigs and syncs each
  team into its designated folder; skips lastSyncTime filter for multi-team
  mode so all issues are always present; ensureSyncFolder/
  findOrCreateNoteForIssue accept folder path as a parameter
- settings-tab.ts: New "Team sync" section with per-team rows (name,
  folder path, enable toggle, remove button) and an "+ Add team" modal
  that auto-loads teams from the Linear API
- main.ts: Sync command now shows toast notifications with created/updated
  counts and error summary
- README.md: Document multi-team sync setup and example folder layout;
  add TeamSyncConfigs to settings table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[feature] Allow to select multiple teams to sync

1 participant