get_custom_fields
Retrieve custom fields for a Backlog project using either project ID or key to configure issue tracking and data collection.
Instructions
Returns list of custom fields 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/getCustomFields.ts:53-63 (handler)The asynchronous handler function that implements the core logic of the 'get_custom_fields' tool: resolves the project identifier using resolveIdOrKey and fetches custom fields via the Backlog client.handler: async ({ projectId, projectKey }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.getCustomFields(result.value); },
- src/tools/getCustomFields.ts:8-27 (schema)Zod-based input schema definition for the tool, specifying optional projectId (number) and projectKey (string) parameters with descriptions.const getCustomFieldsInputSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe( t( 'TOOL_GET_CUSTOM_FIELDS_PROJECT_ID', 'The numeric ID of the project (e.g., 12345)' ) ), projectKey: z .string() .optional() .describe( t( 'TOOL_GET_CUSTOM_FIELDS_PROJECT_KEY', "The key of the project (e.g., 'PROJECT')" ) ), }));
- src/tools/getCustomFields.ts:44-52 (schema)Tool schema configuration: assigns the input schema object, sets output schema to CustomFieldSchema, and lists important output fields.schema: inputSchemaObject, outputSchema: CustomFieldSchema, importantFields: [ 'id', 'name', 'typeId', 'required', 'applicableIssueTypes', ],
- src/tools/tools.ts:103-103 (registration)Registers the get_custom_fields tool by invoking its factory function with Backlog client and translation helper in the 'issue' toolset group.getCustomFieldsTool(backlog, helper),