I would love to see this too - I’ve built the patches for the n8n node… how do I submit them?
# ClickUp Node: Add Support for Creating Tasks from Templates
## Overview
This patch adds support for creating tasks from templates in the n8n ClickUp node, implementing the ClickUp API's "Create Task From Template" functionality.
## API Reference
- **Endpoint**: `POST https://api.clickup.com/api/v2/list/{list_id}/taskTemplate/{template_id}`
- **Documentation**: https://developer.clickup.com/reference/createtaskfromtemplate
## Changes Made
### 1. TaskDescription.ts
- Added new operation "Create From Template" to the task operations list
- Added comprehensive field definitions for the new operation including:
- Team selection (required)
- Space selection (required)
- Folder/Folderless list selection (required)
- Template selection (required)
- Task name (required)
### 2. ClickUp.node.ts
- Added `getTaskTemplates()` method to load available templates from the ClickUp API
- Added implementation for the `createFromTemplate` operation in the execute method
- Uses the correct API endpoint: `/list/{listId}/taskTemplate/{templateId}`
## Features
- **Template Selection**: Users can select from available task templates in their workspace
- **Dynamic Loading**: Templates are loaded dynamically based on the selected team
- **Consistent UI**: Follows the same pattern as other ClickUp node operations
- **Full Integration**: Works with existing folder/folderless list structure
## Usage
1. Select "Task" as the resource
2. Choose "Create From Template" as the operation
3. Select your Team, Space, and List
4. Choose a template from the available options
5. Provide a name for the new task
6. Execute to create a task based on the selected template
## Technical Details
- The implementation follows n8n's standard patterns for node operations
- Uses existing `clickupApiRequest` helper function for API calls
- Leverages existing loadOptions methods for team, space, folder, and list selection
- Adds new `getTaskTemplates` loadOptions method for template selection
## Testing
To test this functionality:
1. Ensure you have task templates created in your ClickUp workspace
2. Configure the ClickUp node with valid credentials
3. Select the "Create From Template" operation
4. Verify that templates load correctly in the dropdown
5. Create a task and verify it matches the template structure
## Compatibility
- Compatible with existing ClickUp node functionality
- No breaking changes to existing operations
- Uses ClickUp API v2 endpoints
- Supports both access token and OAuth2 authentication methods
diff --git a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts
index b1833a8e1e..0f0dfa96d6 100644
--- a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts
+++ b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts
@@ -396,6 +396,22 @@ export class ClickUp implements INodeType {
}
return returnData;
},
+ // Get all the available task templates to display them to user so that they can
+ // select them easily
+ async getTaskTemplates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
+ const teamId = this.getCurrentNodeParameter('team') as string;
+ const returnData: INodePropertyOptions[] = [];
+ const { templates } = await clickupApiRequest.call(this, 'GET', `/team/${teamId}/taskTemplate`);
+ for (const template of templates) {
+ const templateName = template.name;
+ const templateId = template.id;
+ returnData.push({
+ name: templateName,
+ value: templateId,
+ });
+ }
+ return returnData;
+ },
},
};
@@ -930,6 +946,15 @@ export class ClickUp implements INodeType {
}
responseData = await clickupApiRequest.call(this, 'POST', `/list/${listId}/task`, body);
}
+ if (operation === 'createFromTemplate') {
+ const listId = this.getNodeParameter('list', i) as string;
+ const templateId = this.getNodeParameter('template', i) as string;
+ const name = this.getNodeParameter('name', i) as string;
+ const body: IDataObject = {
+ name,
+ };
+ responseData = await clickupApiRequest.call(this, 'POST', `/list/${listId}/taskTemplate/${templateId}`, body);
+ }
if (operation === 'update') {
const taskId = this.getNodeParameter('id', i) as string;
const updateFields = this.getNodeParameter('updateFields', i);
diff --git a/packages/nodes-base/nodes/ClickUp/TaskDescription.ts b/packages/nodes-base/nodes/ClickUp/TaskDescription.ts
index a91188eecd..99efb46fad 100644
--- a/packages/nodes-base/nodes/ClickUp/TaskDescription.ts
+++ b/packages/nodes-base/nodes/ClickUp/TaskDescription.ts
@@ -18,6 +18,12 @@ export const taskOperations: INodeProperties[] = [
description: 'Create a task',
action: 'Create a task',
},
+ {
+ name: 'Create From Template',
+ value: 'createFromTemplate',
+ description: 'Create a task from a template',
+ action: 'Create a task from a template',
+ },
{
name: 'Delete',
value: 'delete',
@@ -853,6 +859,153 @@ export const taskFields: INodeProperties[] = [
],
},
+ /* -------------------------------------------------------------------------- */
+ /* task:createFromTemplate */
+ /* -------------------------------------------------------------------------- */
+ {
+ displayName: 'Team Name or ID',
+ name: 'team',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getTeams',
+ },
+ required: true,
+ },
+ {
+ displayName: 'Space Name or ID',
+ name: 'space',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getSpaces',
+ loadOptionsDependsOn: ['team'],
+ },
+ required: true,
+ },
+ {
+ displayName: 'Folderless',
+ name: 'folderless',
+ type: 'boolean',
+ default: false,
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ },
+ },
+ description: 'Whether the list is in a folder',
+ },
+ {
+ displayName: 'Folder Name or ID',
+ name: 'folder',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ folderless: [false],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getFolders',
+ loadOptionsDependsOn: ['space'],
+ },
+ required: true,
+ },
+ {
+ displayName: 'List Name or ID',
+ name: 'list',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ folderless: [false],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getLists',
+ loadOptionsDependsOn: ['folder'],
+ },
+ required: true,
+ },
+ {
+ displayName: 'List Name or ID',
+ name: 'list',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ folderless: [true],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getFolderlessLists',
+ loadOptionsDependsOn: ['space'],
+ },
+ required: true,
+ },
+ {
+ displayName: 'Template Name or ID',
+ name: 'template',
+ type: 'options',
+ description:
+ 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ },
+ },
+ typeOptions: {
+ loadOptionsMethod: 'getTaskTemplates',
+ loadOptionsDependsOn: ['team'],
+ },
+ required: true,
+ },
+ {
+ displayName: 'Name',
+ name: 'name',
+ type: 'string',
+ default: '',
+ displayOptions: {
+ show: {
+ resource: ['task'],
+ operation: ['createFromTemplate'],
+ },
+ },
+ required: true,
+ description: 'The name for the new task created from template',
+ },
+
/* -------------------------------------------------------------------------- */
/* task:delete */
/* -------------------------------------------------------------------------- */