close_sprint
Close an active sprint to mark it complete. The sprint must be active and cannot be reopened.
Instructions
Close and complete a sprint. This action requires the sprint to be in the "active" state. Once closed, the sprint cannot be reopened.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sprintId | Yes | ID of the sprint to close. |
Implementation Reference
- src/tools/sprints.ts:317-329 (handler)The handler for the close_sprint tool. Validates args using closeSprintSchema, calls jiraClient.closeSprint(), and returns a success message.
case 'close_sprint': { const validatedArgs = await closeSprintSchema.validate(args); const _result = await jiraClient.closeSprint(validatedArgs); return { content: [ { type: 'text', text: `Sprint ${validatedArgs.sprintId} closed successfully`, }, ], }; } - src/jira-client.ts:540-552 (handler)The actual Jira client method that closes a sprint by setting state to 'closed' via partiallyUpdateSprint API.
async closeSprint(input: CloseSprintInput) { try { const updateData: PartiallyUpdateSprint = { sprintId: input.sprintId, state: 'closed' }; const response = await this.agileClient.sprint.partiallyUpdateSprint(updateData); return response; } catch (error) { throw new Error(`Failed to close sprint: ${error instanceof Error ? error.message : 'Unknown error'}`); } } - src/schemas/index.ts:238-240 (schema)Yup schema for close_sprint input validation. Requires 'sprintId' as a number.
export const closeSprintSchema = yup.object({ sprintId: yup.number().required('Sprint ID is required'), }); - src/schemas/index.ts:263-263 (schema)TypeScript type CloseSprintInput inferred from the yup schema.
export type CloseSprintInput = yup.InferType<typeof closeSprintSchema>; - src/tools/sprints.ts:168-181 (registration)Tool registration: defines name 'close_sprint', description, and inputSchema (sprintId required number).
{ name: 'close_sprint', description: 'Close and complete a sprint. This action requires the sprint to be in the "active" state. Once closed, the sprint cannot be reopened.', inputSchema: { type: 'object', properties: { sprintId: { type: 'number', description: 'ID of the sprint to close.', }, }, required: ['sprintId'], }, },