jira_get_field_options
Retrieve available field options for Jira issues by specifying project, issue type, and field to ensure accurate data entry and workflow compliance.
Instructions
Get allowed values/options for a specific field in a project and issue type context
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | Project key | |
| issueType | Yes | Issue type name | |
| fieldKey | Yes | Field key (e.g., 'fixVersions', 'components', 'customfield_10001') |
Implementation Reference
- src/index.ts:1173-1184 (handler)The MCP tool handler case in the switch statement that validates the input parameters using GetFieldOptionsSchema and delegates execution to jiraClient.getFieldOptions, returning the JSON stringified result.case "jira_get_field_options": { const { projectKey, issueType, fieldKey } = GetFieldOptionsSchema.parse(args); const options = await jiraClient.getFieldOptions( projectKey, issueType, fieldKey ); return { content: [{ type: "text", text: JSON.stringify(options, null, 2) }], }; }
- src/jira-client.ts:447-459 (helper)Core implementation of getting field options: retrieves create metadata for the project and issue type via getCreateMeta, finds the specific field by ID, and returns its allowedValues array or empty array.async getFieldOptions( projectKey: string, issueTypeName: string, fieldKey: string ): Promise<unknown> { const meta = await this.getCreateMeta(projectKey, issueTypeName); const issueType = meta.issueTypes[0]; if (!issueType?.fields) { return []; } const field = issueType.fields.find((f) => f.fieldId === fieldKey); return field?.allowedValues || []; }
- src/index.ts:183-191 (schema)Zod schema used for runtime input validation in the tool handler.const GetFieldOptionsSchema = z.object({ projectKey: z.string().describe("Project key"), issueType: z.string().describe("Issue type name"), fieldKey: z .string() .describe( "Field key (e.g., 'fixVersions', 'components', 'customfield_10001')" ), });
- src/index.ts:530-546 (registration)Tool definition registered in the MCP server's tools list, including name, description, and input schema for tool discovery.name: "jira_get_field_options", description: "Get allowed values/options for a specific field in a project and issue type context", inputSchema: { type: "object", properties: { projectKey: { type: "string", description: "Project key" }, issueType: { type: "string", description: "Issue type name" }, fieldKey: { type: "string", description: "Field key (e.g., 'fixVersions', 'components', 'customfield_10001')", }, }, required: ["projectKey", "issueType", "fieldKey"], }, },