add_issue
Create and manage new issues in Backlog projects by specifying project ID, issue type, priority, and summary. Add details like description, dates, assignees, and custom fields for efficient issue tracking.
Instructions
Creates a new issue in the specified project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actualHours | No | Actual work hours | |
| assigneeId | No | User ID of the assignee | |
| attachmentId | No | Attachment IDs | |
| categoryId | No | Category IDs | |
| customFieldId | No | Custom field IDs | |
| customFieldValue | No | Values for custom fields | |
| description | No | Creates a new issue in the specified project. | |
| dueDate | No | Scheduled due date (yyyy-MM-dd) | |
| estimatedHours | No | Estimated work hours | |
| issueTypeId | Yes | Issue type ID | |
| milestoneId | No | Milestone IDs | |
| notifiedUserId | No | User IDs to notify | |
| parentIssueId | No | Parent issue ID | |
| priorityId | Yes | Priority ID | |
| projectId | Yes | Project ID | |
| startDate | No | Scheduled start date (yyyy-MM-dd) | |
| summary | Yes | Summary of the issue | |
| versionId | No | Version IDs |
Implementation Reference
- src/tools/addIssue.ts:124-133 (handler)The main handler function for the 'add_issue' tool. It processes the input parameters, merges custom field payload, and calls the Backlog API to post a new issue.handler: async ({ customFields, ...params }) => { const customFieldPayload = customFieldsToPayload(customFields); const finalPayload = { ...params, ...customFieldPayload, }; return backlog.postIssue(finalPayload); },
- src/tools/addIssue.ts:8-106 (schema)Zod input schema definition for the 'add_issue' tool parameters using buildToolSchema.const addIssueSchema = buildToolSchema((t) => ({ projectId: z.number().describe(t('TOOL_ADD_ISSUE_PROJECT_ID', 'Project ID')), summary: z .string() .describe(t('TOOL_ADD_ISSUE_SUMMARY', 'Summary of the issue')), issueTypeId: z .number() .describe(t('TOOL_ADD_ISSUE_ISSUE_TYPE_ID', 'Issue type ID')), priorityId: z .number() .describe(t('TOOL_ADD_ISSUE_PRIORITY_ID', 'Priority ID')), description: z .string() .optional() .describe( t('TOOL_ADD_ISSUE_DESCRIPTION', 'Detailed description of the issue') ), startDate: z .string() .optional() .describe( t('TOOL_ADD_ISSUE_START_DATE', 'Scheduled start date (yyyy-MM-dd)') ), dueDate: z .string() .optional() .describe(t('TOOL_ADD_ISSUE_DUE_DATE', 'Scheduled due date (yyyy-MM-dd)')), estimatedHours: z .number() .optional() .describe(t('TOOL_ADD_ISSUE_ESTIMATED_HOURS', 'Estimated work hours')), actualHours: z .number() .optional() .describe(t('TOOL_ADD_ISSUE_ACTUAL_HOURS', 'Actual work hours')), categoryId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_CATEGORY_ID', 'Category IDs')), versionId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_VERSION_ID', 'Version IDs')), milestoneId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_MILESTONE_ID', 'Milestone IDs')), assigneeId: z .number() .optional() .describe(t('TOOL_ADD_ISSUE_ASSIGNEE_ID', 'User ID of the assignee')), notifiedUserId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_NOTIFIED_USER_ID', 'User IDs to notify')), attachmentId: z .array(z.number()) .optional() .describe(t('TOOL_ADD_ISSUE_ATTACHMENT_ID', 'Attachment IDs')), parentIssueId: z .number() .optional() .describe(t('TOOL_ADD_ISSUE_PARENT_ISSUE_ID', 'Parent issue ID')), customFields: z .array( z.object({ id: z .number() .describe( t( 'TOOL_ADD_ISSUE_CUSTOM_FIELD_ID', 'The ID of the custom field (e.g., 12345)' ) ), value: z .union([z.number(), z.array(z.number())]) .optional() .describe( 'The ID(s) of the custom field item. For single-select fields, provide a number. For multi-select fields, provide an array of numbers representing the selected item IDs.' ), otherValue: z .string() .optional() .describe( t( 'TOOL_ADD_ISSUE_CUSTOM_FIELD_OTHER_VALUE', 'Other value for list type fields' ) ), }) ) .optional() .describe( t( 'TOOL_ADD_ISSUE_CUSTOM_FIELDS', 'List of custom fields to set on the issue' ) ), }));
- src/tools/tools.ts:91-91 (registration)The 'add_issue' tool is registered in the central 'allTools' function within the 'issue' toolset by invoking the addIssueTool factory.addIssueTool(backlog, helper),