Skip to main content

addChild

client.tasks.addChild(taskId: string, data: CreateTaskRequest): Promise<Task>

Adds a child task to an existing parent task.

Creates a new task as a child of the specified parent task, establishing a hierarchical relationship. Child tasks represent subtasks or components that contribute to completing the parent task. Returns the new child task.

Parameters​

ParameterTypeRequiredDescription
taskIdstringYesThe unique identifier of the parent task
dataCreateTaskRequestYesThe child task creation request

Returns​

Promise<Task> — A promise that resolves to the newly created child Task object

Example​

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.tasks.addChild('taskId', /* CreateTaskRequest */);
console.log(result);