Skip to main content
Glama
leorosignoli

JIRA Zephyr MCP Server

by leorosignoli

link_tests_to_issues

Associate test cases with JIRA issues to track testing activities and requirements. Link test case IDs to relevant issue keys for traceability.

Instructions

Associate test cases with JIRA issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseIdYesTest case ID
issueKeysYesJIRA issue keys to link

Implementation Reference

  • The main handler function that implements the link_tests_to_issues tool. It validates input, loops through issue keys, links each test case to issues using ZephyrClient, and returns results with success/failure counts.
    export const linkTestsToIssues = async (input: LinkTestsToIssuesInput) => { const validatedInput = linkTestsToIssuesSchema.parse(input); try { const results = []; for (const issueKey of validatedInput.issueKeys) { try { await getZephyrClient().linkTestCaseToIssue(validatedInput.testCaseId, issueKey); results.push({ issueKey, success: true, }); } catch (error: any) { results.push({ issueKey, success: false, error: error.response?.data?.message || error.message, }); } } return { success: true, data: { testCaseId: validatedInput.testCaseId, linkResults: results, successCount: results.filter(r => r.success).length, failureCount: results.filter(r => !r.success).length, }, }; } catch (error: any) { return { success: false, error: error.response?.data?.message || error.message, }; } };
  • Zod schema defining the input structure for the link_tests_to_issues tool: testCaseId (required string) and issueKeys (array of strings, at least one).
    export const linkTestsToIssuesSchema = z.object({ testCaseId: z.string().min(1, 'Test case ID is required'), issueKeys: z.array(z.string().min(1)).min(1, 'At least one issue key is required'), });
  • src/index.ts:159-170 (registration)
    Registration of the link_tests_to_issues tool in the MCP server's TOOLS array, including name, description, and input schema for the protocol.
    { name: 'link_tests_to_issues', description: 'Associate test cases with JIRA issues', inputSchema: { type: 'object', properties: { testCaseId: { type: 'string', description: 'Test case ID' }, issueKeys: { type: 'array', items: { type: 'string' }, description: 'JIRA issue keys to link' }, }, required: ['testCaseId', 'issueKeys'], }, },
  • src/index.ts:413-423 (registration)
    Dispatcher case in the MCP server's CallToolRequest handler that validates input using the schema and calls the linkTestsToIssues handler function.
    case 'link_tests_to_issues': { const validatedArgs = validateInput<LinkTestsToIssuesInput>(linkTestsToIssuesSchema, args, 'link_tests_to_issues'); return { content: [ { type: 'text', text: JSON.stringify(await linkTestsToIssues(validatedArgs), null, 2), }, ], }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/leorosignoli/jira-zephyr-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server