← Asana

Add Task To Section with Asana API

Pipedream makes it easy to connect APIs for Asana and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Add Task To Section with the Asana API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Add Task To Section with the Asana API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Add Task To Section action
    1. Connect your Asana account
    2. Optional- Select a Workspace
    3. Optional- Select a Project
    4. Select a Task
    5. Select a Section GID
    6. Optional- Select a Insert Before
    7. Optional- Select a Insert After
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Add Task To Section on Asana
Description:Add a task to a specific, existing section. This will remove the task from other sections of the project. [See the docs here](https://developers.asana.com/docs/add-task-to-section)
Version:0.2.0
Key:asana-add-task-to-section

Code

import asana from "../../asana.app.mjs";
import common from "../common/common.mjs";

export default {
  name: "Add Task To Section",
  description: "Add a task to a specific, existing section. This will remove the task from other sections of the project. [See the docs here](https://developers.asana.com/docs/add-task-to-section)",
  key: "asana-add-task-to-section",
  version: "0.2.0",
  type: "action",
  props: {
    ...common.props,
    task: {
      label: "Task",
      type: "string",
      description: "The task to add to this section.",
      propDefinition: [
        asana,
        "tasks",
        (c) => ({
          project: c.project,
        }),
      ],
    },
    section_gid: {
      label: "Section GID",
      type: "string",
      description: "The globally unique identifier for the section.",
      propDefinition: [
        asana,
        "sections",
        (c) => ({
          project: c.project,
        }),
      ],
    },
    insert_before: {
      label: "Insert Before",
      type: "string",
      description: "An existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after.",
      optional: true,
      propDefinition: [
        asana,
        "tasks",
        (c) => ({
          project: c.project,
        }),
      ],
    },
    insert_after: {
      label: "Insert After",
      type: "string",
      description: "An existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before.",
      optional: true,
      propDefinition: [
        asana,
        "tasks",
        (c) => ({
          project: c.project,
        }),
      ],
    },
  },
  async run({ $ }) {
    const response = await this.asana._makeRequest(`sections/${this.section_gid}/addTask`, {
      method: "post",
      data: {
        data: {
          task: this.task,
          insert_before: this.insert_before,
          insert_after: this.insert_after,
        },
      },
    }, $);

    $.export("$summary", "Successfully added task to section");

    return response;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
AsanaasanaappThis component uses the Asana app.
WorkspaceworkspacestringSelect a value from the drop down menu.
ProjectprojectstringSelect a value from the drop down menu.
TasktaskstringSelect a value from the drop down menu.
Section GIDsection_gidstringSelect a value from the drop down menu.
Insert Beforeinsert_beforestringSelect a value from the drop down menu.
Insert Afterinsert_afterstringSelect a value from the drop down menu.

Authentication

Asana uses OAuth authentication. When you connect your Asana account, Pipedream will open a popup window where you can sign into Asana and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Asana API.

Pipedream requests the following authorization scopes when you connect your account:

About Asana

Manage your team's work, projects, & tasks online