@trg-admin/n8n-nodes-zoho-desk 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -161,6 +161,13 @@ class ZohoDesk {
|
|
|
161
161
|
default: '',
|
|
162
162
|
description: 'ID of existing contact (alternative to email)',
|
|
163
163
|
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Task ID',
|
|
166
|
+
name: 'cfTaskId',
|
|
167
|
+
type: 'string',
|
|
168
|
+
default: '',
|
|
169
|
+
description: 'Custom field Task ID (maps to customFields.cf_task_id)',
|
|
170
|
+
},
|
|
164
171
|
{
|
|
165
172
|
displayName: 'Due Date',
|
|
166
173
|
name: 'dueDate',
|
|
@@ -360,7 +367,7 @@ class ZohoDesk {
|
|
|
360
367
|
loadOptions: {
|
|
361
368
|
async getDepartments() {
|
|
362
369
|
try {
|
|
363
|
-
const responseData = await GenericFunctions_1.zohoDeskApiRequest.call(this, 'GET', '/
|
|
370
|
+
const responseData = await GenericFunctions_1.zohoDeskApiRequest.call(this, 'GET', '/departments', {}, {}, 0);
|
|
364
371
|
const departments = Array.isArray(responseData.data)
|
|
365
372
|
? responseData.data
|
|
366
373
|
: Array.isArray(responseData)
|
|
@@ -377,7 +384,7 @@ class ZohoDesk {
|
|
|
377
384
|
});
|
|
378
385
|
}
|
|
379
386
|
catch (error) {
|
|
380
|
-
throw new Error(`Failed to load departments. Error: ${error.message}. Ensure Organization ID is
|
|
387
|
+
throw new Error(`Failed to load departments. Error: ${error.message}. Ensure Organization ID is correct and Desk API Base URL matches your region.`);
|
|
381
388
|
}
|
|
382
389
|
},
|
|
383
390
|
},
|
|
@@ -423,12 +430,18 @@ class ZohoDesk {
|
|
|
423
430
|
const departmentId = this.getNodeParameter('departmentId', i);
|
|
424
431
|
const description = this.getNodeParameter('description', i, '');
|
|
425
432
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
433
|
+
const { cfTaskId, ...otherAdditionalFields } = additionalFields;
|
|
426
434
|
const body = {
|
|
427
435
|
subject,
|
|
428
436
|
email,
|
|
429
437
|
departmentId,
|
|
430
|
-
...
|
|
438
|
+
...otherAdditionalFields,
|
|
431
439
|
};
|
|
440
|
+
if (cfTaskId) {
|
|
441
|
+
body.customFields = {
|
|
442
|
+
cf_task_id: cfTaskId,
|
|
443
|
+
};
|
|
444
|
+
}
|
|
432
445
|
if (description) {
|
|
433
446
|
body.description = description;
|
|
434
447
|
}
|
|
@@ -439,9 +452,15 @@ class ZohoDesk {
|
|
|
439
452
|
const ticketId = this.getNodeParameter('ticketId', i);
|
|
440
453
|
const description = this.getNodeParameter('description', i, '');
|
|
441
454
|
const additionalFields = this.getNodeParameter('additionalFields', i, {});
|
|
455
|
+
const { cfTaskId, ...otherAdditionalFields } = additionalFields;
|
|
442
456
|
const body = {
|
|
443
|
-
...
|
|
457
|
+
...otherAdditionalFields,
|
|
444
458
|
};
|
|
459
|
+
if (cfTaskId) {
|
|
460
|
+
body.customFields = {
|
|
461
|
+
cf_task_id: cfTaskId,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
445
464
|
if (description) {
|
|
446
465
|
body.description = description;
|
|
447
466
|
}
|