In this tutorial you will learn to configure a Next Matter step that enables your process to automatically create a Task in Asana in the corresponding workspace, project and section.

Prerequisites:

Asana Ids can be found in the URLs.

Steps:

You can also use our step templates to create the required steps

Step 1: Get assignee Id (Optional)

You can set the task assignee dynamically. For that you need to get the Asana User Id. This requires a GET request to Asana API with the following details:

Method: GET

URL: https://app.asana.com/api/1.0/users/<USER_EMAIL>

Headers:

Key           Value
Accept application/json
Content-Type application/json
Authorization Bearer <ASANA_TOKEN>

Name          Value
assignee_id $.data.gid

Step 2: Create Asana Task

This step is the one creating the task in Asana. Here the Integration step configuration:

Method: POST

URL: https://app.asana.com/api/1.0/tasks

Headers:

Key           Value
Accept application/json
Content-Type application/json
Authorization Bearer <ASANA_TOKEN>

Body:

{
"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>"
}
}

Name          Value
task_id $.data.gid

Step 3: Update Task Section (Optional)

In case your Asana project is organised in sections, you can add a step to move the just created task to the correct section. Here the Integration step configuration:

Method: POST

URL: https://app.asana.com/api/1.0/sections/<SECTION_ID>/addTask

Headers:

Key           Value
Accept application/json
Content-Type application/json
Authorization Bearer <ASANA_TOKEN>

Body:

{ "data": { "task": "{Data reference to task_id}" } }

You can get the task id by using Data reference.

Did this answer your question?