Asana Integration
The ticket system integrates with Asana for project and task management. Staff can create Asana tasks directly from tickets, linking project work to support requests.
Overview
| Component | Details |
|---|---|
| API Client | asana/asana (Composer package) |
| Key File | include/custom/class-asana.php |
| UI Page | scp/asana-connect.php |
| Configuration | include/ost-config.php (API key + workspace) |
Features
Task Creation from Tickets
Staff can create an Asana task linked to a ticket:
- Task name defaults to ticket subject
- Task description includes ticket summary and link
- Assigned to the staff member's Asana account
- Due date can be set from the UI
- Project selected from configured workspace
Project Mapping
Tickets can be associated with Asana projects for tracking larger initiatives:
- Multiple tickets can link to the same Asana project
- Project progress visible from staff panel
- Budget hours can be synced with Asana project budgets
Configuration
Settings in include/ost-config.php:
// Asana API credentials
define('ASANA_PAT', 'your_personal_access_token');
define('ASANA_WORKSPACE_ID', 'your_workspace_gid');
Usage Flow
Staff views ticket in scp/tickets.php
→ Clicks "Create Asana Task" action
→ Modal opens with pre-filled data (subject, description, link)
→ Staff selects project, assignee, due date
→ POST to scp/asana-connect.php
→ class-asana.php creates task via Asana API
→ Task GID stored as reference on ticket
→ Link to Asana task displayed on ticket
API Integration
Creating a Task
$asana = new \Asana\Client([
'personalAccessToken' => ASANA_PAT,
]);
$task = $asana->tasks->createTask([
'workspace' => ASANA_WORKSPACE_ID,
'name' => $ticket->getSubject(),
'notes' => $this->buildTaskDescription($ticket),
'assignee' => $staffAsanaGid,
'due_on' => $dueDate,
'projects' => [$projectGid],
]);
Task Description Template
The task description includes:
- Ticket number and link back to the ticket system
- Client name and organization
- AI summary (if available)
- Priority and urgency levels
- Assigned staff member
Staff Mapping
Staff members are mapped to their Asana user GIDs for task assignment. This mapping is managed in the admin settings or configured per-staff member.
Troubleshooting
| Issue | Solution |
|---|---|
| "Invalid token" error | Verify PAT in ost-config.php is current |
| Task not appearing in Asana | Check workspace ID matches; verify project GID |
| Assignee not found | Ensure staff member's Asana GID is configured |
| Rate limit errors | Asana allows 1500 requests/minute — shouldn't be an issue |
Key Files
| File | Purpose |
|---|---|
include/custom/class-asana.php | Asana API wrapper, task creation, project mapping |
scp/asana-connect.php | Staff UI for creating/linking Asana tasks |