Skip to content

fix(cases): add required type parameter to external issue attach/deta…#12

Open
cskmnrpt wants to merge 1 commit intomainfrom
fix/external-issue-attach-detach-type
Open

fix(cases): add required type parameter to external issue attach/deta…#12
cskmnrpt wants to merge 1 commit intomainfrom
fix/external-issue-attach-detach-type

Conversation

@cskmnrpt
Copy link

Purpose

The attach_external_issue and detach_external_issue MCP tools are broken because they send an incorrect payload to the Qase API. The API requires a type field ("jira-cloud" or "jira-server") and a links array structure, but the tools were sending { id, issue_id } with an as any cast hiding the type mismatch.

Changes Made

  • Added required type enum field ('jira-cloud' | 'jira-server') to both AttachExternalIssueSchema and DetachExternalIssueSchema
  • Fixed attachExternalIssue handler to construct correct API payload: { type, links: [{ case_id, external_issues }] }
  • Fixed detachExternalIssue handler with the same payload correction
  • Removed unsafe as any casts from both API calls

Testing

  • npm run build passes
  • npm run lint passes
  • npm test passes (existing tests unaffected)

Review Checklist

  • Code follows project style guidelines
  • No other tools or behaviors affected
  • qaseio dependency untouched
  • Only src/operations/cases.ts modified

Breaking Changes

The MCP tools attach_external_issue and detach_external_issue now require a type parameter. This is technically a breaking change to the tool schema, but the tools were non-functional without it, so no working integrations are affected.

…ch tools

The attach_external_issue and detach_external_issue MCP tools were sending
an incorrect payload to the Qase API. The API requires a `type` field
("jira-cloud" or "jira-server") and a `links` array structure, but the
tools were sending { id, issue_id } with an `as any` cast hiding the
type mismatch.

- Add required `type` enum field to AttachExternalIssueSchema and
  DetachExternalIssueSchema
- Fix both handlers to construct correct API payload:
  { type, links: [{ case_id, external_issues }] }
- Remove unsafe `as any` casts from both API calls

Co-authored-by: Cursor <cursoragent@cursor.com>
@cskmnrpt cskmnrpt requested a review from n3r February 13, 2026 08:18
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