Documentation for searchTasks
Purpose
This node facilitate the querying of tasks from the Asana project management platform. It allows users to retrieve specific tasks based on various filters such as text search, assignee, project, completion status, and the number of results. By providing a structured approach to fetching task data, this logic can streamline project monitoring and task management within the Asana ecosystem.
Settings
1. Workspace
- Input Type: String
- Description: This setting allows the user to specify the unique identifier (GID) of the Asana workspace from which to search for tasks. If not provided, the component attempts to fetch the first available workspace.
- Default Value: An empty string (
'').
2. Text
- Input Type: String
- Description: This setting is a search term that filters tasks based on the content of their names or descriptions. If no text is specified, all tasks within the specified workspace are considered.
- Default Value: An empty string (
'').
3. Assignee
- Input Type: String
- Description: This setting filters the search results to show only tasks assigned to the specified user by their unique Asana user ID. Leaving this blank will include tasks regardless of assignment.
- Default Value: An empty string (
'').
4. Project GID
- Input Type: String
- Description: By specifying a project GID, the user can limit the search to tasks associated with a specific project. If this setting is left blank, tasks from all projects in the workspace will be included in the results.
- Default Value: An empty string (
'').
5. Completed
- Input Type: Boolean/String
- Description: This setting allows users to filter tasks based on their completion status. If set to
true, only completed tasks will be returned; setting it tofalseyields only incomplete tasks. This can be specified as a string ('true'/'false') or boolean value. - Default Value: An empty string (
'').
6. Max Results
- Input Type: Numeric
- Description: This setting determines the maximum number of tasks to return in the search results. This is crucial for performance, as limiting results can ensure quick feedback and prevent overwhelming the user with too much data.
- Default Value: 100.
How It Works
The node operates by gathering inputs and configurations, specifically targeting the Asana workspace to search for tasks. It begins by establishing a connection to Asana through the integration connection. Following this, it checks for a specified workspace. If none is provided, it defaults to the first workspace available.
The function then constructs a search query with the provided filters (text, assignee, project GID, completion status, and the maximum number of results) and fetches tasks from Asana. The results are processed to extract relevant task information (e.g., GID, name, assignee, completion status, project association) and returned in a structured format.
In case of failure during the integration process, the function catches the error and returns an appropriate error message.
Expected Data
This node expects the following data:
-
Inputs:
inputs.workspace: String (optional) – GID of the Asana workspace.inputs.text: String (optional) – Text to search within task names/descriptions.inputs.assignee: String (optional) – GID of the user to filter tasks by assignee.inputs.projectGid: String (optional) – GID of the project to filter tasks.inputs.completed: Boolean/String (optional) – Filter by tasks' completion status.inputs.maxResults: Numeric (optional) – The upper limit for returned tasks.
-
Outputs:
output1: An object containing:data: An array of task objects with their details (GID, name, assignee, completion status, etc.).total: The total count of tasks returned.
Use Cases & Examples
Use Case 1: Task Monitoring
A project manager wants to monitor all tasks assigned to a specific team member for a project currently in progress. They would use searchTasks to retrieve a list of those tasks to check progress and deadlines.
Use Case 2: Reporting Completed Tasks
A business analyst wants to generate a weekly report on completed tasks within a specific project. By using the completed filter, they can easily fetch all tasks marked as done within the last week.
Example Configuration for Use Case 1
Scenario: Retrieve tasks assigned to user U123456 in project P654321 from workspace W987654, limiting to 50 results, and only show incomplete tasks.
{
"inputs": {
"workspace": "W987654",
"assignee": "U123456",
"projectGid": "P654321",
"completed": "false",
"maxResults": 50
}
}This configuration would return up to 50 tasks specifically assigned to the user U123456, filtered by the project P654321, ensuring that no completed tasks are included.