update_sprint
Update a Jira sprint's name, dates, goal, or state. Modify only specified fields; closed sprints accept only name and goal changes.
Instructions
Update sprint information (name, dates, goal, state). Only provided fields will be updated. For closed sprints, only name and goal can be updated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sprintId | Yes | ID of the sprint to update. | |
| name | No | New name for the sprint. | |
| startDate | No | New start date (ISO 8601 format). | |
| endDate | No | New end date (ISO 8601 format). | |
| goal | No | New goal or objective for the sprint. | |
| state | No | New state: "future" for upcoming, "active" to start, "closed" to complete. |
Implementation Reference
- src/tools/sprints.ts:304-316 (handler)The tool handler for 'update_sprint' in the switch statement. Validates args using updateSprintSchema, calls jiraClient.updateSprint(), and returns a success message.
case 'update_sprint': { const validatedArgs = await updateSprintSchema.validate(args); const _result = await jiraClient.updateSprint(validatedArgs); return { content: [ { type: 'text', text: `Sprint ${validatedArgs.sprintId} updated successfully`, }, ], }; } - src/jira-client.ts:521-537 (handler)The JiraClient method that executes the actual Jira API call. Builds a PartiallyUpdateSprint payload with only the provided fields, then calls agileClient.sprint.partiallyUpdateSprint().
async updateSprint(input: UpdateSprintInput) { try { const updateData: PartiallyUpdateSprint = { sprintId: input.sprintId }; // Only include fields that are provided if (input.name !== undefined) updateData.name = input.name; if (input.startDate !== undefined) updateData.startDate = input.startDate; if (input.endDate !== undefined) updateData.endDate = input.endDate; if (input.goal !== undefined) updateData.goal = input.goal; if (input.state !== undefined) updateData.state = input.state; const response = await this.agileClient.sprint.partiallyUpdateSprint(updateData); return response; } catch (error) { throw new Error(`Failed to update sprint: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/schemas/index.ts:228-235 (schema)Yup validation schema for update_sprint input. Requires sprintId, and optionally accepts name, startDate, endDate, goal, and state.
export const updateSprintSchema = yup.object({ sprintId: yup.number().required('Sprint ID is required'), name: yup.string().optional(), startDate: yup.string().optional(), endDate: yup.string().optional(), goal: yup.string().optional(), state: yup.string().oneOf(['future', 'active', 'closed']).optional(), }); - src/schemas/index.ts:262-262 (schema)TypeScript type derived from the updateSprintSchema, used as input type for JiraClient.updateSprint().
export type UpdateSprintInput = yup.InferType<typeof updateSprintSchema>; - src/tools/sprints.ts:133-167 (registration)MCP tool registration for 'update_sprint' in the createSprintTools function, defining its description and input JSON schema.
{ name: 'update_sprint', description: 'Update sprint information (name, dates, goal, state). Only provided fields will be updated. For closed sprints, only name and goal can be updated.', inputSchema: { type: 'object', properties: { sprintId: { type: 'number', description: 'ID of the sprint to update.', }, name: { type: 'string', description: 'New name for the sprint.', }, startDate: { type: 'string', description: 'New start date (ISO 8601 format).', }, endDate: { type: 'string', description: 'New end date (ISO 8601 format).', }, goal: { type: 'string', description: 'New goal or objective for the sprint.', }, state: { type: 'string', enum: ['future', 'active', 'closed'], description: 'New state: "future" for upcoming, "active" to start, "closed" to complete.', }, }, required: ['sprintId'], }, },