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.

Understand how data references work. See Use data references. This will help you use the captured data in the workflow steps.

🚧

Good to know: Check out our ready-made templates available when you add a step and select Templates > 3rd party templates. You can use the templates to create a set of pre-configured steps.
Need a specific template? Click the Contact us button in the top right of the page and let us know.

Dynamically assign tasks in Asana

1. Get assignee_ID

  1. 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
  1. In the Settings, click + Add a variable.
  2. Enter the following variable values

Name: assignee_id

Value: $.data.gid

  1. Save your changes.

2. Create a task in Asana from Next Matter

  1. 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
   }
}
  1. In the Settings, click + Add a variable.
  2. Enter the following variable values:

Name: task_id

Value: $.data.gid

  1. 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.

  1. 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
  1. In the Settings, click + Add a variable.
  2. Enter the following variable values:

Name: assignee_id

Value: $.data.gid

  1. Save your changes.

4. Move a task to a specific Asana section

  1. 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}" } }
  1. Save your changes.