Skip to main content
Glama

create_association

Link two Codebeamer work items with relationships like 'depends on', 'blocks', or 'related to' to establish dependencies and connections between tasks.

Instructions

Create an association (link) between two Codebeamer work items. Common association types: 'depends on', 'blocks', 'related to', 'derived from'. Use get_item_relations on an existing item to discover valid association type IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromItemIdYesSource item ID
toItemIdYesTarget item ID
typeIdYesAssociation type ID (use get_item_relations to discover types)
descriptionNoOptional description for the association

Implementation Reference

  • The handler function for the `create_association` tool in `associations-write.ts` which calls `client.createAssociation`.
    async ({ fromItemId, toItemId, typeId, description }) => {
      const result = await client.createAssociation({
        from: { id: fromItemId },
        to: { id: toItemId },
        type: { id: typeId },
        description,
      });
      const text =
        `**Association created** (ID: ${result.id})\n\n` +
        `| Field | Value |\n|---|---|\n` +
        `| From | #${fromItemId} |\n` +
        `| To | #${toItemId} |\n` +
        `| Type | ${result.type?.name ?? typeId} |` +
        (description ? `\n| Description | ${description} |` : "");
      return { content: [{ type: "text", text }] };
    },
  • The registration block for the `create_association` tool.
    server.registerTool(
      "create_association",
      {
        title: "Create Association",
        description:
          "Create an association (link) between two Codebeamer work items. " +
          "Common association types: 'depends on', 'blocks', 'related to', 'derived from'. " +
          "Use get_item_relations on an existing item to discover valid association type IDs.",
        inputSchema: {
          fromItemId: z
            .number()
            .int()
            .positive()
            .describe("Source item ID"),
          toItemId: z
            .number()
            .int()
            .positive()
            .describe("Target item ID"),
          typeId: z
            .number()
            .int()
            .positive()
            .describe(
              "Association type ID (use get_item_relations to discover types)",
            ),
          description: z
            .string()
            .optional()
            .describe("Optional description for the association"),
        },
      },
  • The actual API call implementation for `createAssociation` inside the `CodebeamerClient`.
    createAssociation(data: CbCreateAssociationRequest): Promise<CbAssociation> {
      return this.http.post("/associations", {
        body: data,
        resource: "create association",
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/3KniGHtcZ/codebeamer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server