create_version
Create a new version in a Yunxiao project to manage release plans, set version owners, and track delivery progress with defined start and publish dates.
Instructions
[Project Management] Create a new version in a Yunxiao Project. Versions are used to manage release plans and track delivery progress.
Use Cases:
Create a new release version Plan project milestones Set version owners and dates
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organizationId | Yes | Organization ID, can be found in the basic information page of the organization admin console | |
| id | Yes | Project unique identifier | |
| name | Yes | Version name, max length 50 characters | |
| owners | Yes | Owner user IDs, at least one required | |
| startDate | No | Start date, format: YYYY-MM-DD | |
| publishDate | No | Publish date, format: YYYY-MM-DD |
Implementation Reference
- Handler case for 'create_version' in the project management tool switch statement. Parses input with CreateVersionSchema, calls createVersionFunc, and returns the result as JSON.
case "create_version": { const args = types.CreateVersionSchema.parse(request.params.arguments); const result = await version.createVersionFunc( args.organizationId, args.id, args.name, args.owners, args.startDate ?? undefined, args.publishDate ?? undefined, ); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } - operations/projex/types.ts:227-234 (schema)Zod schema 'CreateVersionSchema' defining the input parameters: organizationId (string), id (project ID string), name (1-50 chars), owners (array of strings, min 1), startDate (optional nullable string YYYY-MM-DD), publishDate (optional nullable string YYYY-MM-DD).
export const CreateVersionSchema = z.object({ organizationId: z.string().describe("Organization ID, can be found in the basic information page of the organization admin console"), id: z.string().describe("Project unique identifier"), name: z.string().min(1).max(50).describe("Version name, max length 50 characters"), owners: z.array(z.string()).min(1).describe("Owner user IDs, at least one required"), startDate: z.string().nullable().optional().describe("Start date, format: YYYY-MM-DD"), publishDate: z.string().nullable().optional().describe("Publish date, format: YYYY-MM-DD"), }); - tool-registry/project-management.ts:34-38 (registration)Tool registration entry for 'create_version' with name, description, and inputSchema derived from CreateVersionSchema.
{ name: "create_version", description: "[Project Management] Create a new version in a Yunxiao Project. Versions are used to manage release plans and track delivery progress.\n\nUse Cases:\n\nCreate a new release version\nPlan project milestones\nSet version owners and dates", inputSchema: zodToJsonSchema(types.CreateVersionSchema), }, - operations/projex/version.ts:151-183 (helper)Core function 'createVersionFunc' that sends a POST request to the Yunxiao API to create a version. Builds payload with name, owners, and optional startDate/publishDate. Returns the new version's ID.
export async function createVersionFunc( organizationId: string | undefined, id: string, name: string, owners: string[], startDate?: string, publishDate?: string ): Promise<{ id: string }> { const finalOrgId = await resolveOrganizationId(organizationId); const url = isRegionEdition() ? `/oapi/v1/projex/projects/${id}/versions` : `/oapi/v1/projex/organizations/${finalOrgId}/projects/${id}/versions`; const payload: Record<string, any> = { name, owners, }; if (startDate !== undefined) { payload.startDate = startDate; } if (publishDate !== undefined) { payload.publishDate = publishDate; } const response = await yunxiaoRequest(url, { method: "POST", body: payload, }) as { id: string }; return { id: response.id }; } - common/types.ts:77-91 (helper)Re-export of CreateVersionSchema from operations/projex/types.ts, making it available in the common types barrel module.
// Projex types export { // Project schemas GetProjectSchema, SearchProjectsSchema, SearchProgramsSchema, // Version schemas VersionDTOSchema, ListProgramVersionsSchema, ListVersionsSchema, CreateVersionSchema, UpdateVersionSchema, DeleteVersionSchema,