backlog_add_issue
Add a new issue to a Backlog project by specifying details like project ID, summary, issue type, and priority. Streamlines task creation for efficient project management.
Instructions
Add an issue using the Backlog Issue API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actualHours | No | Actual hours for the issue | |
| assigneeId | No | Assignee id | |
| categoryId | No | Category id | |
| description | No | Description of the issue | |
| dueDate | No | Due date of the issue (YYYY-MM-DD format) | |
| estimatedHours | No | Estimated hours for the issue | |
| issueTypeId | Yes | Issue type id | |
| milestoneId | No | Milestone id | |
| priorityId | Yes | Priority id | |
| projectId | Yes | Project id | |
| startDate | No | Start date of the issue (YYYY-MM-DD format) | |
| summary | Yes | Summary of the issue | |
| versionId | No | Version id |
Implementation Reference
- src/tools/handlers.ts:170-202 (handler)The handler function that executes the backlog_add_issue tool: validates input parameters using AddIssueParamsSchema and calls issueService.addIssue to perform the operation.const handleAddIssue: ToolHandler = async (args) => { try { try { const validatedParams = AddIssueParamsSchema.parse(args); const text = await issueService.addIssue(validatedParams); return { content: [ { type: "text", text: `Results for your query:\n${text}`, }, ], isError: false, }; } catch (validationError) { throw new ValidationError( `Invalid parameters: ${validationError instanceof Error ? validationError.message : String(validationError)}`, ); } } catch (error) { return { content: [ { type: "text", text: `Error: ${formatError(error)}`, }, ], isError: true, }; } };
- src/tools/handlers.ts:442-455 (registration)Registers the backlog_add_issue tool name to its handler function handleAddIssue in the toolHandlers map, used by the MCP server.export const toolHandlers: Record<ToolName, ToolHandler> = { backlog_get_projects: handleGetProjects, backlog_get_project: handleGetProject, backlog_get_issues: handleGetIssues, backlog_get_issue: handleGetIssue, backlog_add_issue: handleAddIssue, backlog_update_issue: handleUpdateIssue, backlog_delete_issue: handleDeleteIssue, backlog_get_wikis: handleGetWikis, backlog_get_wiki: handleGetWiki, backlog_add_wiki: handleAddWiki, backlog_update_wiki: handleUpdateWiki, backlog_delete_wiki: handleDeleteWiki, };
- src/core/schema.ts:137-154 (schema)Zod schema defining the input parameters for the backlog_add_issue tool, used for validation.export const AddIssueParamsSchema = z.object({ projectId: z.number().int().describe("Project id"), summary: z.string().describe("Summary"), parentIssueId: z.number().int().optional().describe("Parent issue id"), description: z.string().optional().describe("Description"), startDate: z.string().optional().describe("Start date"), dueDate: z.string().optional().describe("Due date"), estimatedHours: z.number().optional().describe("Estimated hours"), actualHours: z.number().optional().describe("Actual hours"), issueTypeId: z.number().int().describe("Issue type id"), categoryId: z.array(z.number()).optional().describe("Category ids"), versionId: z.array(z.number()).optional().describe("Version ids"), milestoneId: z.array(z.number()).optional().describe("Milestone ids"), priorityId: z.number().int().describe("Priority id"), assigneeId: z.number().int().optional().describe("Assignee id"), notifiedUserId: z.array(z.number()).optional().describe("Notified user ids"), attachmentId: z.array(z.number()).optional().describe("Attachment ids"), });
- src/tools/toolDefinitions.ts:553-557 (registration)Defines the MCP Tool object for backlog_add_issue, including name, description, and input schema converted from Zod schema.export const ADD_ISSUE_TOOL: Tool = createTool( "backlog_add_issue", "Add an issue using the Backlog Issue API.", AddIssueParamsSchema, );
- src/core/types.ts:143-155 (helper)TypeScript union type ToolName that includes "backlog_add_issue" for type safety.export type ToolName = | "backlog_get_projects" | "backlog_get_project" | "backlog_get_issues" | "backlog_get_issue" | "backlog_add_issue" | "backlog_update_issue" | "backlog_delete_issue" | "backlog_get_wikis" | "backlog_get_wiki" | "backlog_add_wiki" | "backlog_update_wiki" | "backlog_delete_wiki";