docs » Asana

Simple spoon that creates a new task in Asana with a given name in a given workspace.

Example configuration (using SpoonInstall.spoon and Seal.spoon):

-- Load configuration constants used throughout the code
consts = require "configConsts" -- just a table

-- Load Asana spoon and configure it with API key
spoon.SpoonInstall:andUse("Asana", { config = { apiKey = consts.asanaApiKey } })

-- Load Seal and setup user actions to add task to Asana workspaces
spoon.SpoonInstall:andUse(
  "Seal",
  {
    fn = function(x)
      x:loadPlugins({"apps", "calc", "useractions", "rot13"})
      x.plugins.useractions.actions = {
        ["New Asana task in " .. consts.asanaWorkWorkspaceName] = {
          fn = function(y) spoon.Asana:createTask(y, consts.asanaWorkWorkspaceName) end,
          keyword = "awork"
        },
        ["New Asana task in " .. consts.asanaPersonalWorkspaceName] = {
          fn = function(y) spoon.Asana:createTask(y, consts.asanaPersonalWorkspaceName) end,
          keyword = "ahome"
        }
      }
      x:refreshAllCommands()
    end,
    start = true,
    hotkeys = { toggle = { "cmd", "space" } }
  }
)

With this setup, adding a new task to Asana is as easy pressing Command + Space to launch Seal and entering, e.g., "awork Do that thing I forgot to do".

API Overview

API Documentation

Variables

apiKey
Signature Asana.apiKey (String)
Type Variable
Description

A "personal access token" for Asana. You can create one here: https://app.asana.com/0/developer-console

Methods

createTask
Signature Asana:createTask(taskName, workspaceName) -> Self
Type Method
Description

Creates a new task named taskName in the workspace workspaceName.

Example:

spoon.Asana.createTask("Do that thing I forgot about", "My Company Workspace")

Parameters:

  • taskName (String) - The title of the Asana task.
  • WorkspaceName (String) - The name of the workspace in which to create the task.

Returns:

  • Self