get_issue
Retrieve Jira issue details by ID or key to access specific fields, properties, and expanded information for project tracking.
Instructions
Retrieve details about an issue by its ID or key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueIdOrKey | Yes | ID or key of the issue | |
| fields | No | Fields to include in the response | |
| expand | No | Additional information to include in the response | |
| properties | No | Properties to include in the response | |
| failFast | No | Fail quickly on errors |
Implementation Reference
- index.js:151-197 (handler)Handler that executes the get_issue tool by fetching issue details from Jira REST API /rest/api/2/issue/{issueIdOrKey} with optional query parameters for fields, expand, properties, and failFast.} else if (name === "get_issue") { const { issueIdOrKey, fields, expand, properties, failFast } = args; try { const queryParams = new URLSearchParams(); if (fields) queryParams.append("fields", fields.join(",")); if (expand) queryParams.append("expand", expand); if (properties) queryParams.append("properties", properties.join(",")); if (failFast !== undefined) queryParams.append("failFast", String(failFast)); const response = await fetch( `${JIRA_INSTANCE_URL}/rest/api/2/issue/${issueIdOrKey}?${queryParams.toString()}`, { method: "GET", headers: { "Content-Type": "application/json", Authorization: `Basic ${Buffer.from(`${JIRA_USER_EMAIL}:${JIRA_API_KEY}`).toString("base64")}`, }, }, ); if (!response.ok) { throw new Error(`Jira API Error: ${response.statusText}`); } const data = await response.json(); return { content: [ { type: "text", text: JSON.stringify(data, null, 2), // Format JSON response }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: `Error: ${error.message}`, }, ], }; } }
- index.js:71-99 (schema)Input schema for the get_issue tool, defining required issueIdOrKey and optional fields, expand, properties, failFast.inputSchema: { type: "object", properties: { issueIdOrKey: { type: "string", description: "ID or key of the issue", }, fields: { type: "array", items: { type: "string" }, description: "Fields to include in the response", }, expand: { type: "string", description: "Additional information to include in the response", }, properties: { type: "array", items: { type: "string" }, description: "Properties to include in the response", }, failFast: { type: "boolean", description: "Fail quickly on errors", default: false, }, }, required: ["issueIdOrKey"], },
- index.js:68-100 (registration)Registration of the get_issue tool in the ListTools response, including name, description, and input schema.{ name: "get_issue", description: "Retrieve details about an issue by its ID or key.", inputSchema: { type: "object", properties: { issueIdOrKey: { type: "string", description: "ID or key of the issue", }, fields: { type: "array", items: { type: "string" }, description: "Fields to include in the response", }, expand: { type: "string", description: "Additional information to include in the response", }, properties: { type: "array", items: { type: "string" }, description: "Properties to include in the response", }, failFast: { type: "boolean", description: "Fail quickly on errors", default: false, }, }, required: ["issueIdOrKey"], }, },