good first issueintegrationnew-featurenew-integration
Repository metrics
- Stars
- (1,930 stars)
- PR merge metrics
- (PR metrics pending)
Description
Description
Add Asana integration to sync tasks, projects, comments, and team activity into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/linear/- Similar project management systemintegrations/todoist/- Task management integrationintegrations/github/- For webhooks and OAuth reference
Required Files Structure
integrations/asana/
├── src/
│ ├── index.ts # Main entry, OAuth spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # Asana API utilities
│ ├── account-create.ts # OAuth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
Asana API Integration
OAuth Setup
- Use OAuth 2.0 Authorization Code flow
- Authorization URL:
https://app.asana.com/-/oauth_authorize - Token URL:
https://app.asana.com/-/oauth_token - Required scopes (format:
<resource>:<action>):tasks:read- Read taskstasks:write- Create/update tasksprojects:read- Read projectsprojects:write- Create/update projectsproject_sections:read- Read project sectionsstories:read- Read comments/storiesusers:read- Read user infoworkspaces:read- Read workspacescustom_fields:read- Read custom fieldsattachments:read- Read attachmentswebhooks:read- Read webhookswebhooks:write- Create/manage webhooks
Key Endpoints
Base URL: https://app.asana.com/api/1.0
GET /users/me- Get current userGET /users- List users in a workspaceGET /workspaces- List workspacesGET /projects?workspace={workspace_gid}- List projects in a workspaceGET /projects/{project_gid}- Get project detailsGET /projects/{project_gid}/tasks- List tasks in a projectGET /projects/{project_gid}/sections- List sections in a projectGET /tasks/{task_gid}- Get task detailsGET /tasks/{task_gid}/stories- Get comments/stories for a taskGET /tasks/{task_gid}/subtasks- Get subtasksGET /tasks/{task_gid}/attachments- Get task attachmentsPOST /webhooks- Create a webhookGET /webhooks?workspace={workspace_gid}- List webhooksDELETE /webhooks/{webhook_gid}- Delete a webhookGET /events?resource={resource_gid}- Get events (polling-based)GET /tags?workspace={workspace_gid}- List tagsGET /custom_fields/{custom_field_gid}- Get custom field details
Events to Track
-
Tasks
- Task created
- Task completed / uncompleted
- Task assigned / reassigned
- Task due date changed
- Task moved between sections
- Subtask added
-
Projects
- Project created / archived
- Task added to / removed from project
- Section created / reordered
-
Comments & Stories
- Comment added to task
- Task description updated
- Attachment added
-
Team Activity
- Team membership changes
- User added to / removed from project
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement OAuth 2.0 Authorization Code flow in
account-create.ts - Create Asana API utilities in
utils.ts(handle pagination withoffsetandnext_page) - Implement sync logic in
schedule.tsfor tasks, projects, and comments - Convert Asana events to CORE activity format
- Add webhook support for real-time task and project events
- Add error handling and rate limiting (150 requests/minute)
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- Asana API is RESTful with JSON request/response format
- Base URL:
https://app.asana.com/api/1.0 - Pagination uses
offsetparameter withnext_page.offsetin response - Use
opt_fieldsquery parameter to request specific fields (reduces payload) - Webhooks require an initial handshake (X-Hook-Secret header)
- Webhook filters support:
action(added, removed, changed, deleted, undeleted),resource_type,resource_subtype - Events API provides polling-based change detection with sync tokens
- Rate limit: 150 requests per minute per user per app
- OAuth scopes follow
<resource>:<action>format; apps without scopes use "Full permissions" - Rich text fields use HTML format
Resources
- Asana API Reference
- OAuth Documentation
- OAuth Scopes
- Webhooks Guide
- Quick Start Guide
- Authentication Overview
Labels
enhancement, good first issue, integration, new-feature, new-integration