get_my_issues
Retrieve all Jira issues currently assigned to you to track tasks and manage workload efficiently.
Instructions
Get all issues currently assigned to the configured CURRENT_USER
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:93-109 (handler)The async handler function that executes the get_my_issues tool logic: constructs JQL for current user's non-Done issues, calls searchIssues helper, formats output or error.async () => { try { const jql = `assignee = ${CURRENT_USER} AND status != Done ORDER BY updated DESC`; const issues = await searchIssues(jql); const output = { issues }; return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } catch (error) { const output = formatError(error); return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, isError: true, }; }
- src/index.ts:75-92 (schema)Input (empty) and output schema for get_my_issues tool using Zod validation.title: 'Get My Issues', description: 'Get all issues currently assigned to the configured CURRENT_USER', inputSchema: {}, outputSchema: { issues: z.array(z.object({ key: z.string(), summary: z.string(), status: z.string(), priority: z.string(), updated: z.string(), })).optional(), error: z.object({ message: z.string(), statusCode: z.number().optional(), details: z.unknown().optional(), }).optional(), }, },
- src/index.ts:72-111 (registration)MCP server registration of the get_my_issues tool including schema and inline handler.server.registerTool( 'get_my_issues', { title: 'Get My Issues', description: 'Get all issues currently assigned to the configured CURRENT_USER', inputSchema: {}, outputSchema: { issues: z.array(z.object({ key: z.string(), summary: z.string(), status: z.string(), priority: z.string(), updated: z.string(), })).optional(), error: z.object({ message: z.string(), statusCode: z.number().optional(), details: z.unknown().optional(), }).optional(), }, }, async () => { try { const jql = `assignee = ${CURRENT_USER} AND status != Done ORDER BY updated DESC`; const issues = await searchIssues(jql); const output = { issues }; return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, }; } catch (error) { const output = formatError(error); return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }], structuredContent: output, isError: true, }; } } );
- src/jira-client.ts:241-277 (helper)The searchIssues helper function called by the handler to perform JQL search on Jira API and map results to simplified issue objects.export async function searchIssues(jql: string, fields: string[] = ['summary', 'status', 'priority', 'updated']): Promise<JiraIssue[]> { const params = new URLSearchParams({ jql, maxResults: '100', }); // Add fields as separate params (the new API accepts array-style) fields.forEach(f => params.append('fields', f)); const response = await jiraFetch<{ issues: Array<{ key: string; id: string; fields: { summary: string; status: { name: string }; priority: { name: string }; updated: string; description?: unknown; assignee?: { displayName: string; accountId: string }; reporter?: { displayName: string; accountId: string }; created?: string; comment?: { comments: Array<{ id: string; author: { displayName: string }; body: unknown; created: string; updated: string }> }; }; }>; isLast?: boolean; nextPageToken?: string; }>(`/search/jql?${params.toString()}`); return response.issues.map((issue) => ({ key: issue.key, summary: issue.fields.summary, status: issue.fields.status.name, priority: issue.fields.priority?.name || 'None', updated: issue.fields.updated, assignee: issue.fields.assignee?.displayName, })); }