Class: LinearToonMcp::Tools::SaveIssue
- Defined in:
- lib/linear_toon_mcp/tools/save_issue.rb
Overview
Create or update a Linear issue. id presence determines create vs update. Resolves human-friendly names to IDs for team, assignee, state, labels, project, cycle, and milestone. Relation params and parentId accept either issue UUIDs or human identifiers (e.g., LIN-123).
Constant Summary collapse
- ISSUE_FIELDS =
standard:enable Layout/LineLength
<<~GRAPHQL id identifier title url state { name } assignee { id name } team { id name } labels { nodes { name } } project { id name } GRAPHQL
- CREATE_MUTATION =
<<~GRAPHQL mutation($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { #{ISSUE_FIELDS.strip} } } } GRAPHQL
- UPDATE_MUTATION =
<<~GRAPHQL mutation($id: String!, $input: IssueUpdateInput!) { issueUpdate(id: $id, input: $input) { success issue { #{ISSUE_FIELDS.strip} } } } GRAPHQL
- RELATION_CREATE_MUTATION =
<<~GRAPHQL mutation($input: IssueRelationCreateInput!) { issueRelationCreate(input: $input) { success } } GRAPHQL
- RELATION_DELETE_MUTATION =
<<~GRAPHQL mutation($id: String!) { issueRelationDelete(id: $id) { success } } GRAPHQL
- RELATIONS_QUERY =
<<~GRAPHQL query($id: String!) { issue(id: $id) { relations { nodes { id type relatedIssue { id } } } } } GRAPHQL
- ISSUE_TEAM_QUERY =
<<~GRAPHQL query($id: String!) { issue(id: $id) { team { id } } } GRAPHQL
- LINK_MUTATION =
<<~GRAPHQL mutation($url: String!, $issueId: String!, $title: String) { attachmentLinkURL(url: $url, issueId: $issueId, title: $title) { success } } GRAPHQL
- RELATION_TYPE_MAP =
{ blocks: "blocks", relatedTo: "related", duplicateOf: "duplicate" }.freeze
Instance Method Summary collapse
-
#perform(id: nil, **kwargs) ⇒ Object
standard:disable Naming/VariableName, Metrics/MethodLength.
Methods inherited from Base
call, #call, error_response, success_response
Instance Method Details
#perform(id: nil, **kwargs) ⇒ Object
standard:disable Naming/VariableName, Metrics/MethodLength
112 113 114 115 |
# File 'lib/linear_toon_mcp/tools/save_issue.rb', line 112 def perform(id: nil, **kwargs) raise Error, "Cannot specify both assignee and delegate" if kwargs.key?(:assignee) && kwargs.key?(:delegate) id ? update(id, kwargs) : create(kwargs) end |