get_issue_types
Retrieve available issue types for a Backlog project to categorize and organize tasks effectively. Specify project ID or key to get relevant issue type options.
Instructions
Returns list of issue types for a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | The numeric ID of the project (e.g., 12345) | |
| projectKey | No | The key of the project (e.g., 'PROJECT') |
Implementation Reference
- src/tools/getIssueTypes.ts:45-55 (handler)The core handler function that executes the tool logic: resolves the project ID or key using resolveIdOrKey utility and calls the Backlog client's getIssueTypes method.handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getIssueTypes(result.value); },
- src/tools/getIssueTypes.ts:8-27 (schema)Input schema for the tool, defining optional projectId (number) or projectKey (string) parameters with descriptions.const getIssueTypesSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_GIT_REPOSITORIES_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_GIT_REPOSITORIES_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), }));
- src/tools/getIssueTypes.ts:29-57 (registration)Exports the getIssueTypesTool factory function that constructs the complete ToolDefinition object for the 'get_issue_types' tool, including name, description, input/output schemas, important fields, and handler.export const getIssueTypesTool = ( backlog: Backlog, { t }: TranslationHelper ): ToolDefinition< ReturnType<typeof getIssueTypesSchema>, (typeof IssueTypeSchema)['shape'] > => { return { name: 'get_issue_types', description: t( 'TOOL_GET_ISSUE_TYPES_DESCRIPTION', 'Returns list of issue types for a project' ), schema: z.object(getIssueTypesSchema(t)), outputSchema: IssueTypeSchema, importantFields: ['id', 'name'], handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getIssueTypes(result.value); }, }; };
- src/tools/tools.ts:104-104 (registration)Registers the get_issue_types tool by calling getIssueTypesTool and adding it to the 'issue' toolset group in the allTools function.getIssueTypesTool(backlog, helper),