← Asana

Create Task Comment 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
Create Task Comment 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 Create Task Comment with the Asana API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Create Task Comment action
    1. Connect your Asana account
    2. Optional- Select a Workspace
    3. Optional- Select a Project
    4. Select a Task GID
    5. Optional- Configure Text
    6. Optional- Configure HTML Text
    7. Optional- Configure Is Pinned
    8. Optional- Configure Sticker Name
  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.

Create Task Comment on Asana
Description:Adds a comment to a task. [See the docs here](https://developers.asana.com/docs/create-a-story-on-a-task)
Version:0.2.0
Key:asana-create-task-comment

Code

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

export default {
  key: "asana-create-task-comment",
  name: "Create Task Comment",
  description: "Adds a comment to a task. [See the docs here](https://developers.asana.com/docs/create-a-story-on-a-task)",
  version: "0.2.0",
  type: "action",
  props: {
    ...common.props,
    task_gid: {
      label: "Task GID",
      description: "The task GID to operate on.",
      type: "string",
      propDefinition: [
        asana,
        "tasks",
        (c) => ({
          project: c.project,
        }),
      ],
    },
    text: {
      label: "Text",
      description: "The plain text of the comment to add. Cannot be used with html_text.",
      type: "string",
      optional: true,
    },
    html_text: {
      label: "HTML Text",
      description: "HTML formatted text for a comment. This will not include the name of the creator.",
      type: "string",
      optional: true,
    },
    is_pinned: {
      label: "Is Pinned",
      description: "Conditional. Whether the story should be pinned on the resource.",
      type: "boolean",
      optional: true,
    },
    sticker_name: {
      label: "Sticker Name",
      description: "The name of the sticker in this story. null if there is no sticker.",
      type: "string",
      optional: true,
    },
  },
  async run({ $ }) {
    const response = await this.asana._makeRequest(`tasks/${this.task_gid}/stories`, {
      method: "post",
      data: {
        data: {
          text: this.text,
          html_text: this.html_text,
          is_pinned: this.is_pinned,
          sticker_name: this.sticker_name,
        },
      },
    }, $);

    $.export("$summary", "Successfully created task comment");

    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.
Task GIDtask_gidstringSelect a value from the drop down menu.
Texttextstring

The plain text of the comment to add. Cannot be used with html_text.

HTML Texthtml_textstring

HTML formatted text for a comment. This will not include the name of the creator.

Is Pinnedis_pinnedboolean

Conditional. Whether the story should be pinned on the resource.

Sticker Namesticker_namestring

The name of the sticker in this story. null if there is no sticker.

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