Tasks
Tasks are the atomic units of work in APM. They represent specific things that need to be done, tracked, and potentially automated.
Task Lifecycle
- Unstarted - Task is created but not begun
- In Progress - Someone (human or AI) is actively working
- Complete - Task is finished
Task Properties
| Property | Description |
|---|---|
title | What needs to be done |
description | Additional context and requirements |
assignee | Who's responsible (user or AI agent) |
status | Current lifecycle stage |
project | Parent project |
implementation_plan | AI-generated or human-written plan |
created_at | When the task was created |
Working with Tasks
Creating Tasks via MCP
There are two primary ways to create tasks:
- From APM Interface - Using the built-in task creation UI
- From MCP Clients - Using the
createTasktool
# Create a basic task
task = mcp_client.call_tool("createTask", {
project_id: "proj_123",
title: "Review customer feedback",
description: "Analyze last week's support tickets for patterns"
})
# Create a task with an implementation plan
task = mcp_client.call_tool("createTask", {
project_id: "proj_123",
title: "Generate weekly report",
assignee_id: "user_456",
implementation_plan: <<~PLAN
1. Query database for last 7 days of data
2. Calculate key metrics and trends
3. Format data into report template
4. Generate PDF and upload to shared drive
PLAN
})
Updating Tasks
Use the updateTask tool to modify task properties:
# Mark task as in progress
mcp_client.call_tool("updateTask", {
task_id: "task_789",
status: "in_progress"
})
# Complete a task
mcp_client.call_tool("updateTask", {
task_id: "task_789",
status: "complete",
completion_notes: "Successfully generated report"
})
# Reassign a task
mcp_client.call_tool("updateTask", {
task_id: "task_789",
assignee_id: "user_123"
})
Querying Tasks
The getTasks tool provides powerful filtering capabilities:
# Get all tasks in a project
tasks = mcp_client.call_tool("getTasks", {
project_id: "proj_123"
})
# Get tasks assigned to a specific user
my_tasks = mcp_client.call_tool("getTasks", {
assignee_id: "user_456",
status: ["unstarted", "in_progress"]
})
# Get recently created tasks
recent_tasks = mcp_client.call_tool("getTasks", {
created_after: "2024-01-01T00:00:00Z",
limit: 10
})
Task Events
APM broadcasts events when tasks change, allowing MCP servers to react:
apm_task_created- New task created with full task data
Coming Soon:
apm_task_updated- Task properties changed (status, assignee, etc.)apm_task_completed- Task marked as completeapm_task_assigned- Task assigned to user or AI agentapm_task_started- Task moved from unstarted to in_progress
Task Automation Patterns
Auto-Assignment Based on Skills
def on_task_created(event)
task = event["task"]
# Auto-assign based on task title keywords
if task["title"].downcase.include?("design")
mcp_client.call_tool("updateTask", {
task_id: task["id"],
assignee_id: "designer_bot_123"
})
elsif task["title"].downcase.include?("code review")
mcp_client.call_tool("updateTask", {
task_id: task["id"],
assignee_id: "senior_dev_456"
})
end
end
Task Dependencies
def on_task_completed(event)
task = event["task"]
# Create follow-up tasks automatically
if task["title"] == "Write unit tests"
mcp_client.call_tool("createTask", {
project_id: task["project_id"],
title: "Run integration tests",
description: "Run full test suite after unit tests completed for #{task['id']}"
})
end
end
Best Practices
- Clear Titles - Task titles should be actionable and specific
- Implementation Plans - Include detailed plans for complex tasks
- Status Updates - Keep task status current for accurate project visibility
- Event-Driven Automation - Use task events to trigger workflows
- Meaningful Descriptions - Provide context that helps both humans and AI understand the task
