fix(cases): add required type parameter to external issue attach/deta…#12
Open
fix(cases): add required type parameter to external issue attach/deta…#12
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The
attach_external_issueanddetach_external_issueMCP tools are broken because they send an incorrect payload to the Qase API. The API requires atypefield ("jira-cloud"or"jira-server") and alinksarray structure, but the tools were sending{ id, issue_id }with anas anycast hiding the type mismatch.Changes Made
typeenum field ('jira-cloud' | 'jira-server') to bothAttachExternalIssueSchemaandDetachExternalIssueSchemaattachExternalIssuehandler to construct correct API payload:{ type, links: [{ case_id, external_issues }] }detachExternalIssuehandler with the same payload correctionas anycasts from both API callsTesting
npm run buildpassesnpm run lintpassesnpm testpasses (existing tests unaffected)Review Checklist
qaseiodependency untouchedsrc/operations/cases.tsmodifiedBreaking Changes
The MCP tools
attach_external_issueanddetach_external_issuenow require atypeparameter. This is technically a breaking change to the tool schema, but the tools were non-functional without it, so no working integrations are affected.