Skip to main content
Glama

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
NameRequiredDescriptionDefault
projectKeyYesProject key
issueTypeYesIssue type name
fieldKeyYesField key (e.g., 'fixVersions', 'components', 'customfield_10001')

Implementation Reference

  • 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) }],
      };
    }
  • 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 || [];
    }
  • 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"],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yogeshhrathod/JiraMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server