get_issue_types
Retrieve all issue types for a Jira project, including names, IDs, descriptions, and workflows. Use this before creating issues to get valid issueType values.
Instructions
Get all available issue types (Bug, Story, Task, Epic, etc.) for a specific project. Returns type names, IDs, descriptions, and workflow information. Required before creating issues to know valid issueType values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | The project key (e.g., "PROJ") or numeric project ID. Use get_projects to find available project keys. |
Implementation Reference
- src/tools/projects.ts:71-91 (handler)Handler for the 'get_issue_types' tool. Validates args using getIssueTypesSchema, calls jiraClient.getIssueTypes(), and returns essential issue type fields (id, name, desc, subtask, level).
case 'get_issue_types': { const validatedArgs = await getIssueTypesSchema.validate(args); const issueTypes = await jiraClient.getIssueTypes(validatedArgs); // Extract essential fields, remove iconUrl, improve text syntax const essentialTypes = issueTypes?.map((type) => ({ id: type.id, name: type.name, desc: type.description, // Shorter field name subtask: type.subtask, level: type.hierarchyLevel // Shorter field name })); return { content: [ { type: 'text', text: JSON.stringify(essentialTypes, null, 2), }, ], }; - src/schemas/index.ts:116-118 (schema)Schema definition for get_issue_types input: requires a 'projectKey' string.
export const getIssueTypesSchema = yup.object({ projectKey: yup.string().required('Project key is required'), }); - src/schemas/index.ts:249-249 (schema)TypeScript type alias GetIssueTypesInput inferred from the schema.
export type GetIssueTypesInput = yup.InferType<typeof getIssueTypesSchema>; - src/tools/projects.ts:26-38 (registration)Registration of the 'get_issue_types' tool: defines name, description, and inputSchema (requiring projectKey).
name: 'get_issue_types', description: 'Get all available issue types (Bug, Story, Task, Epic, etc.) for a specific project. Returns type names, IDs, descriptions, and workflow information. Required before creating issues to know valid issueType values.', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'The project key (e.g., "PROJ") or numeric project ID. Use get_projects to find available project keys.', }, }, required: ['projectKey'], }, }, - src/index.ts:69-70 (registration)Routing registration: tool names starting with 'get_issue_types' are dispatched to handleProjectTool.
if (name.startsWith('get_projects') || name.startsWith('get_issue_types')) { return await handleProjectTool(name, args || {}, this.jiraClient); - src/jira-client.ts:93-104 (helper)JiraClient.getIssueTypes() method that calls the Jira API with projectIdOrKey and expand='issueTypes', returning the issue types list.
// Get issue types for a project async getIssueTypes(input: GetIssueTypesInput) { try { const response = await this.jira.projects.getProject({ projectIdOrKey: input.projectKey, expand: 'issueTypes', }); return response.issueTypes; } catch (error) { throw new Error(`Failed to get issue types: ${error instanceof Error ? error.message : 'Unknown error'}`); } }