Documentation for getTask Logic
Overview
This node is an asynchronous function designed to retrieve detailed information about a specific task from the Asana project management platform. This function facilitates integration between the Vantage analytics & data platform and Asana, allowing users to access task-specific data based on a provided Task Global ID (GID).
Purpose
The primary purpose of getTask is to inquire about the details of a task such as its name, assignee, completion status, due dates, and associated projects or tags. This allows users to seamlessly pull relevant task data into their analytics workflow for reporting, tracking, or further processing.
Settings
This node has several configurable settings that affect its behavior. Each setting is described in detail below.
1. taskGid
- Input Type: String
- Description: The Task Global ID (GID) is a unique identifier required to fetch information about a specific task in Asana. If this value is not provided, the function will return an error indicating that the Task GID is required.
- Default Value: An empty string (
''), which effectively omits the task information retrieval and triggers an error.
2. inputs
- Input Type: Object
- Description: An object that allows the user to pass in various input values. It should include
taskGidamong other potential inputs if needed in future configurations or integrations. - Default Value:
{}(an empty object)
3. config
- Input Type: Object
- Description: This object allows the user to specify configuration options that modify the behavior of this node. The primary configuration option is
taskGid, but this could be extended in future updates. - Default Value:
{}(an empty object)
4. context
- Input Type: Object
- Description: This object provides additional contextual information for the integration, including authentication tokens and user-specific data. It is necessary for establishing a connection with the Asana API.
- Default Value:
{}(an empty object)
Error Handling
The function includes built-in error handling to manage situations where the task GID is missing or if an error occurs during the API call to Asana. In such cases, the function returns an error message specifying the problem.
Workflow
- Input Validation: The function checks if a valid
taskGidis provided throughinputsorconfig. If not, it returns an error. - Integration Setup: The function calls the integration connection with 'asana' as a parameter and uses the context provided to establish a connection with the Asana API.
- Data Retrieval: Using the established integration, the task information is fetched using the provided
taskGid. - Output Construction: If successful, the function structures the output data into a predefined format, including important task attributes such as name, assignee, completion status, and due dates.
- Error Handling: In case of any internal errors during the API request, the function captures the error and returns a descriptive message.
Data Expected
The node expects the following data:
- A valid Asana Task GID (
taskGid), which should correspond to an existing task within a user's Asana workspace. - Valid context data necessary for authentication with Asana's API.
Use Cases & Examples
Use Cases
-
Project Performance Tracking: A project manager can use
getTaskto track the completion status of specific tasks within ongoing projects, reporting on how many tasks are completed versus outstanding. -
Automated Reporting: An analytics dashboard can automate the retrieval of task details from Asana, compiling them into reports to share with stakeholders throughout project lifecycles.
-
Workflow Automation: By integrating
getTaskinto a larger automation sequence, developers can trigger notifications or updates in response to changes in task statuses (like marking tasks as complete).
Configuration Example
Use Case: Project Performance Tracking
Sample Configuration Data:
{
"inputs": {
"taskGid": "1234567890123456"
},
"config": {},
"context": {
"authToken": "yourAsanaAccessToken"
}
}Explanation:
In this example, the user has provided the taskGid corresponding to a specific task they wish to retrieve. The context contains an authentication token required to access the Asana API, allowing getTask to successfully obtain detailed information about task 1234567890123456. The resulting output will contain attributes such as task name, completion status, due date, and any associated projects or tags, facilitating tracking and performance evaluation.