2020-01-18 14:19:31 -08:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
|
|
|
|
|
|
|
export const taskOperations = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a task',
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a task',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
description: 'Get a task',
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
|
|
|
description: 'Update a task',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
|
|
|
] as INodeProperties[];
|
|
|
|
|
|
|
|
export const taskFields = [
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* task:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Team',
|
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Space',
|
|
|
|
name: 'space',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'team',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2020-01-26 14:46:10 -08:00
|
|
|
{
|
2020-01-26 19:48:57 -08:00
|
|
|
displayName: 'Folderless List',
|
|
|
|
name: 'folderless',
|
2020-01-26 14:46:10 -08:00
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2020-01-18 14:19:31 -08:00
|
|
|
{
|
|
|
|
displayName: 'Folder',
|
|
|
|
name: 'folder',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
2020-01-26 19:48:57 -08:00
|
|
|
folderless: [
|
2020-01-26 14:46:10 -08:00
|
|
|
false,
|
|
|
|
],
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'space',
|
2020-01-26 14:46:10 -08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'List',
|
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
2020-01-26 19:48:57 -08:00
|
|
|
folderless: [
|
2020-01-26 14:46:10 -08:00
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolderlessLists',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'space',
|
|
|
|
],
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'List',
|
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
2020-01-26 19:48:57 -08:00
|
|
|
folderless: [
|
2020-01-26 14:46:10 -08:00
|
|
|
false,
|
|
|
|
],
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getLists',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'folder',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
description: 'The first name on the task',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Assignees',
|
|
|
|
name: 'assignees',
|
|
|
|
type: 'multiOptions',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
typeOptions: {
|
2020-01-18 18:36:57 -08:00
|
|
|
loadOptionsMethod: 'getAssignees',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Content',
|
|
|
|
name: 'content',
|
|
|
|
type: 'string',
|
2020-01-18 14:19:31 -08:00
|
|
|
typeOptions: {
|
2020-01-18 18:36:57 -08:00
|
|
|
alwaysOpenEditWindow: true,
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
2020-01-18 18:36:57 -08:00
|
|
|
default: '',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Due Date',
|
|
|
|
name: 'dueDate',
|
|
|
|
type: 'dateTime',
|
2020-01-18 14:19:31 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Due Date Time',
|
|
|
|
name: 'dueDateTime',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Is Markdown Content',
|
|
|
|
name: 'markdownContent',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Notify All',
|
|
|
|
name: 'notifyAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Parent ID',
|
|
|
|
name: 'parentId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
2020-01-18 18:36:57 -08:00
|
|
|
{
|
|
|
|
displayName: 'Priority',
|
|
|
|
name: 'priority',
|
|
|
|
type: 'number',
|
|
|
|
typeOptions: {
|
2020-01-26 19:50:17 -08:00
|
|
|
minValue: 1,
|
2020-01-18 18:36:57 -08:00
|
|
|
maxValue: 4,
|
|
|
|
},
|
|
|
|
description: 'Integer mapping as 1 : Urgent, 2 : High, 3 : Normal, 4 : Low',
|
|
|
|
default: 3,
|
|
|
|
},
|
2020-01-18 14:19:31 -08:00
|
|
|
{
|
|
|
|
displayName: 'Start Date Time',
|
|
|
|
name: 'startDateTime',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Status',
|
|
|
|
name: 'status',
|
|
|
|
type: 'options',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'list',
|
|
|
|
],
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getStatuses',
|
|
|
|
},
|
|
|
|
default: '',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'multiOptions',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'space',
|
|
|
|
],
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTags',
|
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
description: 'The array of tags applied to this task',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time Estimate',
|
|
|
|
name: 'timeEstimate',
|
|
|
|
type: 'number',
|
|
|
|
description: 'time estimate in minutes',
|
|
|
|
default: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* task:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Task ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Task ID',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Content',
|
|
|
|
name: 'content',
|
|
|
|
type: 'string',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
2020-01-18 18:36:57 -08:00
|
|
|
{
|
|
|
|
displayName: 'Due Date',
|
|
|
|
name: 'dueDate',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Due Date Time',
|
|
|
|
name: 'dueDateTime',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
2020-01-18 14:19:31 -08:00
|
|
|
{
|
|
|
|
displayName: 'Is Markdown Content',
|
|
|
|
name: 'markdownContent',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Name',
|
|
|
|
name: 'name',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Notify All',
|
|
|
|
name: 'notifyAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Parent ID',
|
|
|
|
name: 'parentId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Priority',
|
|
|
|
name: 'priority',
|
|
|
|
type: 'number',
|
|
|
|
typeOptions: {
|
2020-01-26 19:50:17 -08:00
|
|
|
minValue: 1,
|
2020-01-18 18:36:57 -08:00
|
|
|
maxValue: 4,
|
|
|
|
},
|
|
|
|
description: 'Integer mapping as 1 : Urgent, 2 : High, 3 : Normal, 4 : Low',
|
|
|
|
default: 3,
|
2020-01-18 14:19:31 -08:00
|
|
|
},
|
|
|
|
{
|
2020-01-18 18:36:57 -08:00
|
|
|
displayName: 'Start Date Time',
|
|
|
|
name: 'startDateTime',
|
2020-01-18 14:19:31 -08:00
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time Estimate',
|
|
|
|
name: 'timeEstimate',
|
|
|
|
type: 'number',
|
|
|
|
description: 'time estimate in minutes',
|
|
|
|
default: 1,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* task:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Task ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Task ID',
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* task:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'task',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'task ID',
|
|
|
|
},
|
|
|
|
] as INodeProperties[];
|