Skip to content

Conversation

@jamiew
Copy link

@jamiew jamiew commented Oct 17, 2025

Add support for linking GitHub PRs and external URLs to Linear issues via a new linctl issue attach command.

Forgive me if this is overly verbose or incorrect, I am new to golang

The Linear API supports quite a few special 'resource' parameters for GitHub PRs specifically so I implemented them for completeness, but I'm not using them personally. Just trying to do a simple "oops forgot to use the magic git branch-naming trick; please attach this PR to new or existing Linear ticket"

changes:

  • Add linctl issue attach command with --pr and --url flags
  • Implement CreateAttachment() API function using Linear's attachmentCreate mutation
  • Add comprehensive documentation to README with examples
  • Support both full GitHub PR URLs and PR numbers

example usage:

# Link a GitHub PR
linctl issue attach LIN-123 --pr https://github.com/owner/repo/pull/456
linctl issue attach LIN-123 --pr 456

# or attach any URL:
linctl issue attach LIN-123 --url https://example.com --title "Design Mockup"

checklist:

  • all smoke tests pass (39/39)
  • golangci-lint clean (0 issues)
  • go fmt compliant
  • follows existing code patterns to best of my human & LLM-enabled abilities

@jamiew jamiew changed the title Add GitHub PR attachment support Add support for attaching GitHub PRs to issues Oct 17, 2025
charlietran and others added 2 commits October 28, 2025 16:49
Implement ability to attach issues to projects at creation time:
- Add --project flag to accept project UUID
- Include projectId in GraphQL mutation input
- Display project name in creation success message
- Update CreateIssue query to return project information

Usage: linctl issue create --title "Task" --team ENG --project <PROJECT-ID>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implement ability to set labels on issues:
- Add --labels flag to issue create command (comma-separated label IDs)
- Add --labels flag to issue update command (replaces existing labels)
- Display attached labels in creation success message
- Parse and pass labelIds array to GraphQL mutations

Usage:
  linctl issue create --title "Bug" --team ENG --labels <ID1>,<ID2>
  linctl issue update ENG-123 --labels <ID1>,<ID2>
  linctl issue update ENG-123 --labels ""  # Clear all labels

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
charlietran and others added 8 commits November 10, 2025 09:40
- Display cycle in issue list table and plaintext output
- Add --cycle flag to filter by current or specific cycle number
- Fix cycle field showing NULL by including it in GraphQL queries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix cycle display logic to show cycle number when name is empty
- Show "Cycle N" format when Linear returns empty cycle name
- Update all import paths from dorkitude/linctl to charlietran/linctl
- Ensures compatibility with forked module path

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add cycle filter examples to main issue command help
- Add dedicated examples section to issue list command
- Add cycle filter examples to issue search command
- Show both 'current' and specific cycle number usage
- Include combined filter examples (e.g., priority + cycle)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Resolve conflicts in cmd/issue.go by keeping both label flags from upstream and PR attachment flags from feature branch
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.

2 participants