4 min read

Documentation for the updateTask Logic

Overview

This node is designed to facilitate the modification of tasks within the Asana project management tool. It allows users to update various properties of a specific task by utilizing Asana's API. This component is especially useful for applications that require dynamic task management, enabling seamless integration with Asana's task structure based on user input and automation workflows.

Settings

The updateTask component has several settings that are critical for its functionality. Below is a detailed breakdown of each setting:

  1. Setting Name: taskGid

    • Input Type: String
    • Purpose: This setting specifies the global identifier (GID) for the Asana task that needs to be updated. It is a required field, and failure to provide a valid GID will result in an error.
    • Default Value: None (mandatory input).
  2. Setting Name: name

    • Input Type: String
    • Purpose: This setting is used to update the name of the Asana task. If left empty, the task name will remain unchanged.
    • Default Value: '' (empty string means no change will occur).
  3. Setting Name: notes

    • Input Type: String
    • Purpose: This setting allows for the update of the notes or description associated with the task. Similar to the name, if left unfilled, the existing notes will remain intact.
    • Default Value: '' (empty string means no change will occur).
  4. Setting Name: assignee

    • Input Type: String
    • Purpose: This setting specifies the email or user ID of the person to whom the task will be assigned. If not provided, the assignment remains unchanged.
    • Default Value: '' (empty string means no change will occur).
  5. Setting Name: dueOn

    • Input Type: String (date format)
    • Purpose: This setting is used to update the due date of the task. If no date is given, the due date will not be modified.
    • Default Value: '' (empty string means no change will occur).
  6. Setting Name: startOn

    • Input Type: String (date format)
    • Purpose: This setting governs the start date of the task. If empty, there will be no changes to the task's start date.
    • Default Value: '' (empty string means no change will occur).
  7. Setting Name: completed

    • Input Type: Boolean (true/false format)
    • Purpose: This setting indicates whether the task should be marked as completed (true) or not completed (false). Any other input is treated as no change.
    • Default Value: '' (empty string means no change will occur).

How It Works

  1. Input Handling: The logic first gathers inputs from two sources: the inputs object and the config object. It prioritizes inputs over config, falling back to defaults if necessary.

  2. Validation: The logic checks for the presence of the taskGid. If it is absent, an error message is returned, indicating that the task GID is mandatory for the operation.

  3. Asana Integration: The logic then utilizes the the integration connection function to create an integration instance with Asana, using the provided context.

  4. Task Update: Using the Asana API, the task is updated with the parameters passed. Only fields that are defined (not empty) will be modified. If any errors occur during the API call, a corresponding error message is returned.

  5. Output Generation: Upon successful completion of the update, the logic returns an output containing the task's GID and a confirmation of the update.

Expected Data

This node expects input data that follows the schema defined in the settings. It requires the task GID as a mandatory field and provides optional fields for various task attributes such as name, notes, assignee, due dates, and completion status.

Use Cases & Examples

Use Case 1: Task Management Automation

A project manager needs to automatically update tasks as their priorities shift throughout a project lifecycle. Using updateTask, they can design an automation workflow to adjust task details based on specific workflows.

Use Case 2: Team Collaboration

In a collaborative environment, team members may need to update task assignments and deadlines dynamically as team workloads change. updateTask allows for such modifications in real-time through connected systems.

Use Case 3: Integration with Other Tools

An organization that uses multiple productivity tools can consolidate task updates from various platforms (like Slack, or custom-built apps) through this node, ensuring that changes are reflected in Asana.

Concrete Example

In this example, the task with the GID 1234567890 will have its assignee updated to john.doe@example.com and its due date set to November 15, 2023, while leaving the task name and notes unchanged.