get_issue
Retrieve detailed information about a Jira issue using its key or ID to access issue data, status, and metadata.
Instructions
Get detailed information about a Jira issue by its key or ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | The issue key (e.g., PROJ-123) or issue ID (e.g., 378150) |
Implementation Reference
- src/handlers/issue-handlers.ts:36-66 (handler)The handleGetIssue method in IssueHandlers class that fetches issue details using JiraApiClient, retrieves field metadata, formats the issue using JiraFormatters.formatIssue, and handles errors.async handleGetIssue(args: any) { try { const { issueKey } = args; if (!issueKey) { throw new Error('issueKey is required'); } const issue = await this.apiClient.get(`/issue/${issueKey}`); const fieldMetadata = await this.getFieldMetadata(); return { content: [ { type: 'text', text: JiraFormatters.formatIssue(issue, fieldMetadata), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
- src/tools/definitions.ts:4-16 (schema)Defines the tool schema for 'get_issue', specifying the inputSchema with required 'issueKey' parameter and description.name: 'get_issue', description: 'Get detailed information about a Jira issue by its key or ID', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'The issue key (e.g., PROJ-123) or issue ID (e.g., 378150)', }, }, required: ['issueKey'], }, },
- src/index.ts:98-99 (registration)Registers the 'get_issue' tool by routing calls in the MCP server's CallToolRequestSchema handler to the IssueHandlers.handleGetIssue method.case 'get_issue': return this.issueHandlers.handleGetIssue(request.params.arguments);
- src/handlers/issue-handlers.ts:13-33 (helper)Private helper method in IssueHandlers to fetch and cache field metadata from Jira API, used for formatting issue fields in get_issue.private async getFieldMetadata(): Promise<Map<string, string>> { if (this.fieldMetadataCache) { return this.fieldMetadataCache; } try { const fields = await this.apiClient.get('/field'); const metadata = new Map<string, string>(); fields.forEach((field: any) => { if (field.id && field.name) { metadata.set(field.id, field.name); } }); this.fieldMetadataCache = metadata; return metadata; } catch (error) { // If field metadata fetch fails, return empty map return new Map<string, string>(); }