Connectors / Service / Asana

Asana

Asana

Asana is a web and mobile application designed to help teams organize, track, and manage their work

Overview

The Asana connector on Tray allows you to interact with the data in your Asana account in any way you choose. The majority of the API is currently supported on Tray, enabling you to do things like:

  • Copy a project for each new Salesforce Opportunity that's created
  • Add project status updates
  • Add comments
  • Attach files to tasks

Authentication

When using the Asana connector, the first thing you will have to do is click on 'New Authentication' in the step editor:

On the following page proceed to allow Tray access to your account.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Note on using Asana

List Tasks

When using the List Tasks operation you should only choose one of Assignee ID or Project ID:

If you choose an option for both you will receive an error message such as:

Search Tasks

The Search Tasks operation is only available to premium Asana users.

A user is a premium if any of the following is true:

  • The workspace in which the search is being performed is a premium workspace.
  • The user is a member of a premium team inside the workspace.

Even if a user is only a member of a premium team inside a non-premium workspace, the search will allow them to find data anywhere in the workspace, not just inside the premium team.

When using Search Tasks, you must send a minimum of one parameter from either 'Search parameters' or 'Custom fields' inputs.

For more information on how to use each 'Search parameter', you can find details in the Asana documentation v1.0 - Search tasks in a workspace. The document helps to find the exact format that Asana will be expecting the 'Search parameters' to be passed in.

Example

This example demonstrates how to use a workflow to create a new task and send a slack message with the task name:

You will need to create two steps:

  1. Create task (using the asana connector)
  2. Send message (using the slack connector)

With the Create task operation you will need to specify the Workflow ID to which the new task will belong and its Name, all the other properties are not mandatory.

With the Send message operation you will need to specify the Channel to which the message will be sent and of course the message body. In this example, the message body will be {$.steps.asana-1.data.name} has been created so that you can combine both text and the JSON path to the name of the task created in the previous step.

You can run this workflow and see the logs in the DEBUG section. The output of the first step should look like this:

{
"data": {
"notes": "",
"assignee_status": "upcoming",
"gid": "972375047894944",
"num_likes": 0,
"hearted": false,
"num_hearts": 0,
"completed_at": null,
"modified_at": "2019-01-09T14:37:42.867Z",
"resource_subtype": "default_task",
"due_on": null,
"parent": null,
"created_at": "2019-01-09T14:37:42.867Z",
"resource_type": "task",
"completed": false,
"name": "This is a task",
"hearts": [],
"liked": false,
"assignee": null,
"followers": [
{
"gid": "68711130877162",
"id": 68711130877162,
"resource_type": "user",
"name": "A person"
}
],
"workspace": {
"gid": "498346170860",
"id": 498346170860,
"resource_type": "workspace",
"name": "Personal Projects"
},
"tags": [],
"projects": [
{
"gid": "969484041887157",
"id": 969484041887157,
"resource_type": "project",
"name": "test"
}
],
"id": 972375047894944,
"start_on": null,
"likes": [],
"memberships": [
{
"project": {
"gid": "969484041887157",
"id": 969484041887157,
"resource_type": "project",
"name": "test"
},
"section": null
}
],
"due_at": null
}
}

The output of the second step should look like this:

{
"ok": true,
"channel": "D2DRPB1J9",
"ts": "1547014664.000300",
"message": {
"type": "message",
"subtype": "bot_message",
"text": "This is a task has been created",
"ts": "1547014664.000300",
"username": "Tray.io",
"icons": {
"image_48": "https://imageurl.png"
},
"bot_id": "BCA3SHKJN",
"attachments": []
}
}

All Operations

Latest version:

5.4