mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
✨ Add Checklist createItem functionality to Trello Node (#1444)
* Add Trello Checklist createItem functionality * 💄 Small cosmetic change to #1433 Co-authored-by: Nicolas Antoniazzi <nicolas@codingame.com>
This commit is contained in:
parent
19412b6025
commit
c1ddb6c000
|
@ -18,6 +18,11 @@ export const checklistOperations = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Create Checklist Item',
|
||||||
|
value: 'createCheckItem',
|
||||||
|
description: 'Create a checklist item',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Create',
|
name: 'Create',
|
||||||
value: 'create',
|
value: 'create',
|
||||||
|
@ -276,6 +281,79 @@ export const checklistFields = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ----------------------------------
|
||||||
|
// checklist:createCheckItem
|
||||||
|
// ----------------------------------
|
||||||
|
{
|
||||||
|
displayName: 'Checklist ID',
|
||||||
|
name: 'checklistId',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
required: true,
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'createCheckItem',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'checklist',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'The ID of the checklist to update.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Name',
|
||||||
|
name: 'name',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
required: true,
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'createCheckItem',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'checklist',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
description: 'The name of the new check item on the checklist.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Additional Fields',
|
||||||
|
name: 'additionalFields',
|
||||||
|
type: 'collection',
|
||||||
|
placeholder: 'Add Field',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'createCheckItem',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'checklist',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: {},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Checked',
|
||||||
|
name: 'checked',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: 'Determines whether the check item is already checked when created.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Position',
|
||||||
|
name: 'pos',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
description: 'The position of the checklist on the card. One of: top, bottom, or a positive number.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// checklist:deleteCheckItem
|
// checklist:deleteCheckItem
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
|
@ -565,6 +565,21 @@ export class Trello implements INodeType {
|
||||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
Object.assign(qs, additionalFields);
|
Object.assign(qs, additionalFields);
|
||||||
|
|
||||||
|
} else if (operation === 'createCheckItem') {
|
||||||
|
// ----------------------------------
|
||||||
|
// createCheckItem
|
||||||
|
// ----------------------------------
|
||||||
|
|
||||||
|
requestMethod = 'POST';
|
||||||
|
|
||||||
|
const checklistId = this.getNodeParameter('checklistId', i) as string;
|
||||||
|
|
||||||
|
endpoint = `checklists/${checklistId}/checkItems`;
|
||||||
|
|
||||||
|
const name = this.getNodeParameter('name', i) as string;
|
||||||
|
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||||
|
Object.assign(qs, { name, ...additionalFields });
|
||||||
|
|
||||||
} else if (operation === 'deleteCheckItem') {
|
} else if (operation === 'deleteCheckItem') {
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// deleteCheckItem
|
// deleteCheckItem
|
||||||
|
|
Loading…
Reference in a new issue