feat: Add issue relations support (blocks, related, duplicate, similar)#24
feat: Add issue relations support (blocks, related, duplicate, similar)#24ralfschimmel wants to merge 1 commit intolinearis-oss:mainfrom
Conversation
Add support for managing issue relationships through a new `issues relations` subcommand group. This enables tracking dependencies between issues, which is essential for AI agents that need to understand task ordering and blockers. New commands: - `issues relations list <issueId>` - List all relations for an issue - `issues relations add <issueId> --blocks|--related|--duplicate|--similar <ids>` - `issues relations remove <relationId>` - Remove a relation by UUID Features: - Support for all Linear relation types: blocks, related, duplicate, similar - Comma-separated IDs for adding multiple relations at once - Human-friendly ID resolution (TEAM-123 format) - Relations included in `issues read` output - Both outgoing and inverse relations combined in output Technical details: - Optimized GraphQL queries with new ISSUE_RELATIONS_FRAGMENT - Proper validation for null/undefined nested relation data - UUID validation for relation removal - Partial success reporting when batch relation creation fails - Comprehensive unit tests (23 tests) and integration tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
iamfj
left a comment
There was a problem hiding this comment.
This aligns well with the Linear GraphQL spec and keeps the CLI consistent with the underlying API—great call on streamlining the supported options!
Everything looks well-implemented and clean.
LGTM 🚀
Thanks for the thoughtful work on this!
|
Thanks for the work on issue relations, @ralfschimmel — this was a much-requested feature. Unfortunately, the codebase has gone through a complete architecture redesign since this PR was opened (see #49). The project now uses a five-layer architecture with GraphQL codegen, and the code in this PR is no longer compatible with the current structure. I'm closing this PR, but the feature request in #55 is still open. If you're interested in picking it back up against the new architecture, that would be very welcome — the patterns are documented in Thank you for contributing! 🙏 |
Why Issue Relations Matter for AI Agents
When AI agents work on complex projects, understanding task dependencies is critical. An agent needs to know:
Without visibility into these relationships, agents make suboptimal decisions—starting blocked work, missing related context, or duplicating effort. Linearis, being designed for LLM agents, should expose this relationship data to enable smarter task planning and execution.
Summary
This PR adds comprehensive issue relations support through a new
issues relationssubcommand group:linearis issues relations list ABC-123linearis issues relations add ABC-123 --blocks DEF-456,DEF-789linearis issues relations remove <relation-uuid>All four Linear relation types are supported:
--blocks- This issue blocks the specified issues--related- General relationship between issues--duplicate- This issue is a duplicate of another--similar- Similar issues (note: typically AI-generated by Linear)Relations are also now included in
issues readoutput, giving agents complete context when examining an issue.Example Usage
Output Format
{ "issueId": "550e8400-e29b-12d3-a456-426614174000", "identifier": "ABC-123", "relations": [ { "id": "660e8400-e29b-12d3-a456-426614174001", "type": "blocks", "issue": {"id": "...", "identifier": "ABC-123", "title": "Parent task"}, "relatedIssue": {"id": "...", "identifier": "DEF-456", "title": "Blocked task"}, "createdAt": "2025-01-15T10:30:00.000Z" } ] }Technical Implementation
ISSUE_RELATIONS_FRAGMENTin GraphQL queries fetching bothrelationsandinverseRelationsLinearIssueRelationTypeScript interface for type safety_options: unknownwith explanatory comments)Test Plan
🤖 Generated with Claude Code