add_issues_to_sprint
Add GitHub issues to an existing sprint for organized project management and workflow tracking.
Instructions
Add issues to an existing sprint
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sprintId | Yes | ||
| issueIds | Yes |
Implementation Reference
- Main handler method in ProjectManagementService that loops through issueIds and calls sprintRepo.addIssue for each, returning success count and message.async addIssuesToSprint(data: { sprintId: string; issueIds: string[]; }): Promise<{ success: boolean; addedIssues: number; message: string }> { try { let addedCount = 0; const issues = []; // Add each issue to the sprint for (const issueId of data.issueIds) { try { await this.sprintRepo.addIssue(data.sprintId, issueId); addedCount++; issues.push(issueId); } catch (error) { process.stderr.write(`Failed to add issue ${issueId} to sprint: ${error}`); } } return { success: addedCount > 0, addedIssues: addedCount, message: `Added ${addedCount} issue(s) to sprint ${data.sprintId}` }; } catch (error) { throw this.mapErrorToMCPError(error); } }
- ToolDefinition including name, description, input schema (addIssuesToSprintSchema), and examples for the add_issues_to_sprint tool.export const addIssuesToSprintTool: ToolDefinition<AddIssuesToSprintArgs> = { name: "add_issues_to_sprint", description: "Add issues to an existing sprint", schema: addIssuesToSprintSchema as unknown as ToolSchema<AddIssuesToSprintArgs>, examples: [ { name: "Add issues to sprint", description: "Add multiple issues to an existing sprint", args: { sprintId: "sprint_1", issueIds: ["123", "124", "125"] } } ] };
- src/infrastructure/tools/ToolRegistry.ts:234-240 (registration)Registration of sprint-related tools in ToolRegistry's registerBuiltInTools method, including addIssuesToSprintTool.this.registerTool(createSprintTool); this.registerTool(listSprintsTool); this.registerTool(getCurrentSprintTool); this.registerTool(updateSprintTool); this.registerTool(addIssuesToSprintTool); this.registerTool(removeIssuesFromSprintTool);
- Private helper in GitHubSprintRepository that performs the actual GraphQL mutation to update project item field values, assigning issues to sprint (iteration).private async addIssuesToSprint(sprintId: string, issueIds: IssueId[]): Promise<void> { const addItemQuery = ` mutation($input: UpdateProjectV2ItemFieldValueInput!) { updateProjectV2ItemFieldValue(input: $input) { projectV2Item { id } } } `; for (const issueId of issueIds) { await this.graphql(addItemQuery, { input: { projectId: this.config.projectId, itemId: `Issue_${issueId}`, fieldId: sprintId, value: "ITERATION", }, }); } }
- src/index.ts:377-378 (handler)Tool dispatching handler in main server index.ts that routes the tool call to ProjectManagementService.addIssuesToSprint.case "add_issues_to_sprint": return await this.service.addIssuesToSprint(args);