get_issue
Retrieve detailed information about a Jira issue including status, assignee, description, comments, and workflow data to check its current state before making updates.
Instructions
Retrieve detailed information about a specific Jira issue including status, assignee, description, comments, and workflow data. Use this to get current state before making updates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueKey | Yes | Issue key (e.g., "PROJ-123") or numeric issue ID. This is the unique identifier for the issue. | |
| expand | No | Comma-separated list of additional data: renderedFields,names,schema,transitions,operations,editmeta,changelog | |
| fields | No | Specific fields to return (e.g., ["summary", "status", "assignee"]). If not specified, returns all fields. |
Implementation Reference
- src/tools/issues.ts:71-92 (registration)Tool registration for 'get_issue' as part of createIssueTools() - defines name, description, and inputSchema with issueKey (required), expand, and fields parameters.
name: 'get_issue', description: 'Retrieve detailed information about a specific Jira issue including status, assignee, description, comments, and workflow data. Use this to get current state before making updates.', inputSchema: { type: 'object', properties: { issueKey: { type: 'string', description: 'Issue key (e.g., "PROJ-123") or numeric issue ID. This is the unique identifier for the issue.', }, expand: { type: 'string', description: 'Comma-separated list of additional data: renderedFields,names,schema,transitions,operations,editmeta,changelog', }, fields: { type: 'array', items: { type: 'string' }, description: 'Specific fields to return (e.g., ["summary", "status", "assignee"]). If not specified, returns all fields.', }, }, required: ['issueKey'], }, }, - src/schemas/index.ts:133-137 (schema)Validation schema for get_issue: issueKey (required string), expand (optional string), fields (optional array of strings).
export const getIssueSchema = yup.object({ issueKey: yup.string().required('Issue key is required'), expand: yup.string().optional(), fields: yup.array().of(yup.string()).optional(), }); - src/tools/issues.ts:189-273 (handler)Handler for 'get_issue' tool in handleIssueTool(): validates args with getIssueSchema, calls jiraClient.getIssue(), then simplifies and returns issue data (summary, description, status, priority, assignee, reporter, project, issuetype, parent, subtasks, labels, components, etc.) as JSON.
case 'get_issue': { const validatedArgs = await getIssueSchema.validate(args); const issue = await jiraClient.getIssue(validatedArgs); // Filter and simplify the issue data const simplifiedIssue = { id: issue.id, key: issue.key, self: issue.self, fields: { summary: issue.fields.summary, description: issue.fields.description, status: { id: issue.fields.status?.id, name: issue.fields.status?.name, statusCategory: { id: issue.fields.status?.statusCategory?.id, key: issue.fields.status?.statusCategory?.key, name: issue.fields.status?.statusCategory?.name } }, priority: { id: issue.fields.priority?.id, name: issue.fields.priority?.name }, assignee: issue.fields.assignee ? { accountId: issue.fields.assignee.accountId, displayName: issue.fields.assignee.displayName, emailAddress: issue.fields.assignee.emailAddress } : null, reporter: issue.fields.reporter ? { accountId: issue.fields.reporter.accountId, displayName: issue.fields.reporter.displayName, emailAddress: issue.fields.reporter.emailAddress } : null, creator: issue.fields.creator ? { accountId: issue.fields.creator.accountId, displayName: issue.fields.creator.displayName, emailAddress: issue.fields.creator.emailAddress } : null, project: { id: issue.fields.project?.id, key: issue.fields.project?.key, name: issue.fields.project?.name }, issuetype: { id: issue.fields.issuetype?.id, name: issue.fields.issuetype?.name, subtask: issue.fields.issuetype?.subtask }, parent: issue.fields.parent ? { id: issue.fields.parent.id, key: issue.fields.parent.key } : null, subtasks: issue.fields.subtasks?.map(subtask => ({ id: subtask.id, key: subtask.key })) || [], labels: issue.fields.labels || [], components: issue.fields.components?.map(comp => ({ id: comp.id, name: comp.name })) || [], fixVersions: issue.fields.fixVersions?.map(version => ({ id: version.id, name: version.name, released: version.released })) || [], created: issue.fields.created, updated: issue.fields.updated, duedate: issue.fields.duedate, resolution: issue.fields.resolution, resolutiondate: issue.fields.resolutiondate } }; return { content: [ { type: 'text', text: JSON.stringify(simplifiedIssue, null, 2), }, ], }; } - src/jira-client.ts:157-168 (helper)JiraClient.getIssue() method: calls the Jira API (jira.issues.getIssue) with issueIdOrKey, expand, and fields filters, returning a Promise<Issue>.
async getIssue(input: GetIssueInput): Promise<Issue> { try { const response = await this.jira.issues.getIssue({ issueIdOrKey: input.issueKey, expand: input.expand, fields: input.fields?.filter(field => field !== undefined) as string[], }); return response as unknown as Issue; } catch (error) { throw new Error(`Failed to get issue: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/index.ts:71-77 (registration)Tool routing in main server: routes 'get_issue' (startsWith) to handleIssueTool() in the CallToolRequestSchema handler.
} else if ( name.startsWith('create_issue') || name.startsWith('get_issue') || name.startsWith('update_issue') || name.startsWith('delete_issue') ) { return await handleIssueTool(name, args || {}, this.jiraClient);