Create Task Command

Command to create a new task in a workspace or project

Overview

The CreateTaskCommand initiates the creation of a new task with all relevant metadata.

Example

{
"commandId": "cmd_create_task_123",
"commandType": "CreateTaskCommand",
"timestamp": "2025-12-11T15:00:00Z",
"version": "1.0.0",
"data": {
"workspaceId": "ws_acme_corp",
"projectId": "proj_website",
"title": "Implement user authentication",
"description": "Add OAuth2 login with Google and GitHub",
"priority": "high",
"status": "backlog",
"createdBy": {
"userId": "usr_john_doe",
"name": "John Doe"
},
"labels": ["feature", "backend"],
"estimatedPoints": 8,
"dueDate": "2025-12-20T23:59:59Z"
}
}

Validation Rules

  • Title must be 1-500 characters
  • User must have permission to create tasks
  • Project must exist and be accessible
  • Labels must be valid for workspace
  • Priority must be one of: critical, high, medium, low
  • Estimated points must be positive number

Results

Success: TaskCreated event is published

Failures:

  • InvalidTaskData: Validation failed
  • InsufficientPermissions: User lacks create permission
  • ProjectNotFound: Invalid project ID