Integrate with Asana
You can integrate with Asana to automatically create a task in Asana in a workspace, project, and section from a Next Matter workflow..
Before you begin
To start integrating you need the following data from Asana:
- your Personal Access Token (see Asana documentation)
- your workspace, project, and task IDs. These can be extracted from URLs. For example, a task URL is constructed in the following way:
https://app.asana.com/0/PROJECT_ID/TASK_ID
- your Asana section ID. You can query for it with this call.
- your task name. You can use Asana search to get it.
Additionally, you'll need to understand how data references work. See Use data references.
Check out our ready-made Asana template available when you add a step and select Step templates > Integrations. You can use the templates to create a set of pre-configured steps.
Dynamically assign tasks in Asana
1. Get assignee_ID
- Create a step in Integration > Custom integration with the following settings:
- Method: GET
- URL:
https://app.asana.com/api/1.0/users/USER_EMAIL
- Headers: Content-type:
application/json
- Headers: Authorization:
ASANA_PERSONAL_ACCESS_TOKEN
- Headers: Accept:
application/json
- In the Settings, click + Add a variable.
- Enter the following variable values
Name: assignee_id
Value: $.data.gid
- Save your changes.
2. Create a step in Asana from Next Matter
- Create a step in Integration > Custom integration with the following settings:
- Method: POST
- URL:
https://app.asana.com/api/1.0/tasks
- Headers: Content-type:
application/json
- Headers: Authorization:
ASANA_PERSONAL_ACCESS_TOKEN
- Headers: Accept:
application/json
- Body (an example)
{
"data": {
"approval_status": "pending",
"assignee": "{2. Get Assignee Id - Integration step - assignee_id (string)}",
"due_at": "2022-07-25T00:00:00+0000",
"followers": ["{1. Enter Task details - Task assignee - User Selection (user email)}"],
"name": "{1. Enter Task details - Task name - Input}",
"html_notes": "<body>{1. Enter Task details - Task details - Input} </body>",
"projects": ["ASANA_PROJECT_ID"],
"start_at": "2022-07-11T00:00:00+0000",
"workspace": "ASANA_WORKSPACE_ID"//this is a placeholder
}
}
- In the Settings, click + Add a variable.
- Enter the following variable values:
Name: task_id
Value: $.data.gid
- Save your changes.
3. Update the task section
This is an optional step. In case your Asana project is organized in sections, you can add a step to move the just-created task to the correct section.
- Create a step in Integration > Custom integration with the following settings:
- Method: GET
- URL:
https://app.asana.com/api/1.0/users/USER_EMAIL
- Headers: Content-type:
application/json
- Headers: Authorization:
ASANA_PERSONAL_ACCESS_TOKEN
- Headers: Accept:
application/json
- In the Settings, click + Add a variable.
- Enter the following variable values:
Name: assignee_id
Value: $.data.gid
- Save your changes.
4. Create a step in Asana from Next Matter
- Create a step in Integration > Custom integration with the following settings:
- Method: POST
- URL:
https://app.asana.com/api/1.0/sections/SECTION_ID/addTask
- Headers: Content-type:
application/json
- Headers: Authorization:
ASANA_PERSONAL_ACCESS_TOKEN
- Headers: Accept:
application/json
- Body (an example)
{ "data": { "task": "{Data reference to task_id}" } }
- Save your changes.
Updated 3 months ago