add_version_milestone
Create a new version milestone in Backlog projects to track release timelines. Specify project details and milestone dates for efficient project management.
Instructions
Creates a new version milestone
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | Project ID | |
| projectKey | No | Project key | |
| name | Yes | Version name | |
| description | No | Creates a new version milestone | |
| startDate | No | Start date of the version | |
| releaseDueDate | No | Release due date of the version | |
| organization | No | Optional organization name. Use list_organizations to inspect available organizations. |
Implementation Reference
- src/tools/addVersionMilestone.ts:65-75 (handler)The handler function for the add_version_milestone tool. It resolves the project ID or key using resolveIdOrKey, then calls backlog.postVersions() to create the version milestone.
handler: async ({ projectId, projectKey, ...params }) => { const result = resolveIdOrKey( 'project', { id: projectId, key: projectKey }, t ); if (!result.ok) { throw result.error; } return backlog.postVersions(result.value, params); }, - Input schema definition using Zod. Defines fields: projectId (optional number), projectKey (optional string), name (required string), description (optional string), startDate (optional string), releaseDueDate (optional string).
const addVersionMilestoneSchema = buildToolSchema((t) => ({ projectId: z .number() .optional() .describe(t('TOOL_ADD_VERSION_MILESTONE_PROJECT_ID', 'Project ID')), projectKey: z .string() .optional() .describe(t('TOOL_ADD_VERSION_MILESTONE_PROJECT_KEY', 'Project key')), name: z .string() .describe(t('TOOL_ADD_VERSION_MILESTONE_NAME', 'Version name')), description: z .string() .optional() .describe( t('TOOL_ADD_VERSION_MILESTONE_DESCRIPTION', 'Version description') ), startDate: z .string() .optional() .describe( t('TOOL_ADD_VERSION_MILESTONE_START_DATE', 'Start date of the version') ), releaseDueDate: z .string() .optional() .describe( t( 'TOOL_ADD_VERSION_MILESTONE_RELEASE_DUE_DATE', 'Release due date of the version' ) ), })); - The VersionSchema defines the output/response shape for version milestone operations. Used as the outputSchema for the add_version_milestone tool.
export const VersionSchema = z.object({ id: z.number(), projectId: z.number(), name: z.string(), description: z.string().optional(), startDate: z.string().optional(), releaseDueDate: z.string().optional(), archived: z.boolean(), displayOrder: z.number(), }); - src/utils/resolveIdOrKey.ts:51-55 (helper)The resolveIdOrKey helper function used by the handler to resolve the project identifier (either numeric ID or string key) into a single value for the backlog API call.
export const resolveIdOrKey = <E extends EntityName>( entity: E, values: { id?: number; key?: string }, t: TranslationHelper['t'] ): ResolveResult => resolveIdOrField(entity, 'key', values, t); - src/tools/tools.ts:119-122 (registration)Registration of the addVersionMilestoneTool in the 'issue' tools group within the allTools function. It's listed alongside other version milestone tools.
getVersionMilestoneListTool(backlog, helper), addVersionMilestoneTool(backlog, helper), updateVersionMilestoneTool(backlog, helper), deleteVersionTool(backlog, helper),