jira_get_create_meta
Retrieve required fields and allowed values for creating Jira issues in a specific project, ensuring proper issue setup by identifying mandatory inputs and dropdown options before submission.
Instructions
Get metadata for creating issues - shows required fields and allowed values (dropdown options) for a project and issue type. IMPORTANT: Call this before creating an issue to know what fields are required and what values are allowed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | Project key to get metadata for | |
| issueType | No | Issue type name to filter (e.g., Bug, Task, Story) |
Implementation Reference
- src/jira-client.ts:310-362 (handler)Core handler function that retrieves create metadata for a Jira project, fetching issue types and their field configurations including required fields and allowed values.async getCreateMeta( projectKey: string, issueTypeName?: string ): Promise<{ projectKey: string; issueTypes: Array<{ id: string; name: string; fields?: Array<{ fieldId: string; name: string; required: boolean; hasAllowedValues: boolean; allowedValues?: Array<{ id: string; name: string; value?: string }>; }>; }>; }> { const issueTypesResult = await this.getCreateMetaIssueTypes(projectKey); const issueTypes = issueTypesResult.values; // Filter by issue type name if provided const filteredTypes = issueTypeName ? issueTypes.filter( (t) => t.name.toLowerCase() === issueTypeName.toLowerCase() ) : issueTypes; // Get fields for each issue type const result = { projectKey, issueTypes: await Promise.all( filteredTypes.map(async (issueType) => { const fieldsResult = await this.getCreateMetaFields( projectKey, issueType.id ); return { id: issueType.id, name: issueType.name, fields: fieldsResult.values.map((f) => ({ fieldId: f.fieldId, name: f.name, required: f.required, hasAllowedValues: !!f.allowedValues, allowedValues: f.allowedValues, })), }; }) ), }; return result; }
- src/index.ts:121-127 (schema)Zod schema defining input parameters for the jira_get_create_meta tool: projectKey (required) and optional issueType.const GetCreateMetaSchema = z.object({ projectKey: z.string().describe("Project key to get metadata for"), issueType: z .string() .optional() .describe("Issue type name to filter (e.g., Bug, Task, Story)"), });
- src/index.ts:456-474 (registration)Tool registration in the list of available tools, including name, description, and input schema.{ name: "jira_get_create_meta", description: "Get metadata for creating issues - shows required fields and allowed values (dropdown options) for a project and issue type. IMPORTANT: Call this before creating an issue to know what fields are required and what values are allowed.", inputSchema: { type: "object", properties: { projectKey: { type: "string", description: "Project key to get metadata for", }, issueType: { type: "string", description: "Issue type name to filter (e.g., Bug, Task, Story)", }, }, required: ["projectKey"], }, },
- src/jira-client.ts:259-277 (helper)Helper method to fetch available issue types for create meta in a project via Jira API.async getCreateMetaIssueTypes(projectKey: string): Promise<{ values: Array<{ id: string; name: string; description: string; subtask: boolean; }>; total: number; }> { return this.request<{ values: Array<{ id: string; name: string; description: string; subtask: boolean; }>; total: number; }>(`/issue/createmeta/${projectKey}/issuetypes`); }
- src/jira-client.ts:280-307 (helper)Helper method to fetch field metadata (required, allowed values) for a specific issue type in create meta context.async getCreateMetaFields( projectKey: string, issueTypeId: string ): Promise<{ values: Array<{ fieldId: string; name: string; required: boolean; allowedValues?: Array<{ id: string; name: string; value?: string }>; schema: { type: string; system?: string; custom?: string }; defaultValue?: unknown; }>; total: number; }> { return this.request<{ values: Array<{ fieldId: string; name: string; required: boolean; allowedValues?: Array<{ id: string; name: string; value?: string }>; schema: { type: string; system?: string; custom?: string }; defaultValue?: unknown; }>; total: number; }>( `/issue/createmeta/${projectKey}/issuetypes/${issueTypeId}?maxResults=100` ); }