From 5b88dd8319c785ffea8c9247fe0fa11a2a9a4637 Mon Sep 17 00:00:00 2001 From: David Durman Date: Wed, 18 Sep 2024 09:34:32 +0200 Subject: [PATCH] last polishing details --- .../WatchOrganizations/component.json | 2 +- .../AddCommentToTicket/AddCommentToTicket.js | 4 +- .../tickets/AddCommentToTicket/component.json | 16 +- .../tickets/CreateTicket/CreateTicket.js | 4 +- .../tickets/CreateTicket/component.json | 186 ++++++++--------- .../tickets/DeleteTicket/component.json | 5 +- .../FindTicketComments/FindTicketComments.js | 3 +- .../tickets/FindTickets/component.json | 2 +- .../tickets/UpdateTicket/UpdateTicket.js | 4 +- .../tickets/UpdateTicket/component.json | 192 +++++++++--------- .../tickets/WatchTickets/component.json | 8 +- .../users/FindUsers/component.json | 2 +- .../users/WatchUsers/component.json | 2 +- 13 files changed, 214 insertions(+), 216 deletions(-) diff --git a/src/appmixer/zendesktickets/organizations/WatchOrganizations/component.json b/src/appmixer/zendesktickets/organizations/WatchOrganizations/component.json index 1a375dbbc..20fa8a2b2 100644 --- a/src/appmixer/zendesktickets/organizations/WatchOrganizations/component.json +++ b/src/appmixer/zendesktickets/organizations/WatchOrganizations/component.json @@ -24,7 +24,7 @@ "type": "multiselect", "label": "Event Types", "description": "Select one or more event types to watch for.", - "index": 0, + "index": 1, "options": [ { "label": "Organization Created", "value": "zen:event-type:organization.created" }, { "label": "Organization Custom Field Changed", "value": "zen:event-type:organization.custom_field_changed" }, diff --git a/src/appmixer/zendesktickets/tickets/AddCommentToTicket/AddCommentToTicket.js b/src/appmixer/zendesktickets/tickets/AddCommentToTicket/AddCommentToTicket.js index 7b0b2b4ad..3022dcec2 100644 --- a/src/appmixer/zendesktickets/tickets/AddCommentToTicket/AddCommentToTicket.js +++ b/src/appmixer/zendesktickets/tickets/AddCommentToTicket/AddCommentToTicket.js @@ -26,8 +26,8 @@ module.exports = { } if (input['ticket|attachments']) { const fileIds = (input['ticket|attachments'].ADD || []) - .map(attachment => (attachment.fileId || null)) - .filter(fileId => fileId !== null); + .map(attachment => (attachment.fileId || null)) + .filter(fileId => fileId !== null); for (const fileId of fileIds) { const { data } = await this.uploadFile(context, fileId); requestBody.ticket.comment.uploads = requestBody.ticket.comment.uploads || []; diff --git a/src/appmixer/zendesktickets/tickets/AddCommentToTicket/component.json b/src/appmixer/zendesktickets/tickets/AddCommentToTicket/component.json index c1ceae07b..30bbd202f 100644 --- a/src/appmixer/zendesktickets/tickets/AddCommentToTicket/component.json +++ b/src/appmixer/zendesktickets/tickets/AddCommentToTicket/component.json @@ -45,24 +45,24 @@ { "value": "html", "label": "HTML" } ] }, - "ticket|comment|public": { - "type": "toggle", - "index": 3, - "label": "Is The New Comment Public", - "tooltip": "Set if the new comment should be public." - }, "ticket|comment|body": { "type": "textarea", - "index": 2, + "index": 3, "label": "New Comment", "tooltip": "The body of the new comment that will be added to the ticket." }, + "ticket|comment|public": { + "type": "toggle", + "index": 4, + "label": "Is The New Comment Public", + "tooltip": "Set if the new comment should be public." + }, "ticket|attachments": { "type": "expression", "group": "transformation", "label": "Attachments", "tooltip": "Attachments for the ticket.", - "index": 7, + "index": 5, "levels": [ "ADD" ], "fields": { "fileId": { diff --git a/src/appmixer/zendesktickets/tickets/CreateTicket/CreateTicket.js b/src/appmixer/zendesktickets/tickets/CreateTicket/CreateTicket.js index 9104c4714..7d4162f36 100644 --- a/src/appmixer/zendesktickets/tickets/CreateTicket/CreateTicket.js +++ b/src/appmixer/zendesktickets/tickets/CreateTicket/CreateTicket.js @@ -74,8 +74,8 @@ module.exports = { } if (input['ticket|attachments']) { const fileIds = (input['ticket|attachments'].ADD || []) - .map(attachment => (attachment.fileId || null)) - .filter(fileId => fileId !== null); + .map(attachment => (attachment.fileId || null)) + .filter(fileId => fileId !== null); for (const fileId of fileIds) { const { data } = await this.uploadFile(context, fileId); requestBody.ticket.comment.uploads = requestBody.ticket.comment.uploads || []; diff --git a/src/appmixer/zendesktickets/tickets/CreateTicket/component.json b/src/appmixer/zendesktickets/tickets/CreateTicket/component.json index 8fcb445ed..78d0291f7 100644 --- a/src/appmixer/zendesktickets/tickets/CreateTicket/component.json +++ b/src/appmixer/zendesktickets/tickets/CreateTicket/component.json @@ -107,78 +107,27 @@ "label": "Subject", "tooltip": "The value of the subject field for this ticket." }, - "ticket|comment|body_format": { - "type": "select", - "index": 2, - "label": "Comment Format", - "tooltip": "The format of the comment.", - "options": [ - { "value": "text", "content": "Text or Markdown" }, - { "value": "html", "label": "HTML" } - ] - }, - "ticket|comment|public": { - "type": "toggle", - "index": 3, - "label": "Is Comment Public", - "tooltip": "Set if the comment should be public." - }, - "ticket|comment|body": { - "type": "textarea", - "index": 2, - "label": "Comment" - }, "ticket|assignee_email": { "type": "text", - "index": 3, + "index": 2, "label": "Assignee Email", "tooltip": "The email address of the agent to assign the ticket to. Example: john@example.com." }, - "ticket|requester_name": { - "type": "text", - "index": 3, - "label": "Requester Name", - "tooltip": "The name of the requester. Example: Pablo." - }, - "ticket|requester_email": { - "type": "text", - "index": 3, - "label": "Requester Email", - "tooltip": "The email address of the requester. Example: pablito@example.org." - }, - "ticket|email_ccs": { - "type": "text", - "index": 3, - "label": "Email CCs", - "tooltip": "A comma separated list of email addresses to send email notification about the ticket creation to. Example: john@example.com,bob@example.com." - }, "ticket|collaborator_emails": { "type": "text", "index": 3, "label": "Collaborator Emails", "tooltip": "A comma separated list of email addresses of collaborators. Example: john@example.com,bob@example.com." }, - "ticket|due_at": { - "type": "date-time", - "index": 4, - "label": "Task Due At", - "tooltip": "If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format.
JSON array. Example: \"1933-02-07T05:09:11.0Z\"." - }, - "ticket|external_id": { - "type": "text", - "index": 5, - "label": "External Id", - "tooltip": "An id you can use to link Zendesk Support tickets to local records." - }, - "ticket|group_id": { + "ticket|organization_id": { "type": "select", - "index": 6, - "label": "Group ID", - "tooltip": "The group this ticket is assigned to.", + "index": 4, + "label": "Organization ID", + "tooltip": "The organization of the requester. You can only specify the ID of an organization associated with the requester.", "source": { - "url": "/component/appmixer/zendesktickets/groups/FindGroups?outPort=out", + "url": "/component/appmixer/zendesktickets/organizations/FindOrganizations?outPort=out", "data": { - "transform": "./FindGroups#toSelectArray", + "transform": "./FindOrganizations#toSelectArray", "messages": { "in/query": "name:*", "in/outputType": "array" @@ -186,15 +135,15 @@ } } }, - "ticket|organization_id": { + "ticket|group_id": { "type": "select", - "index": 7, - "label": "Organization ID", - "tooltip": "The organization of the requester. You can only specify the ID of an organization associated with the requester.", + "index": 5, + "label": "Group ID", + "tooltip": "The group this ticket is assigned to.", "source": { - "url": "/component/appmixer/zendesktickets/organizations/FindOrganizations?outPort=out", + "url": "/component/appmixer/zendesktickets/groups/FindGroups?outPort=out", "data": { - "transform": "./FindOrganizations#toSelectArray", + "transform": "./FindGroups#toSelectArray", "messages": { "in/query": "name:*", "in/outputType": "array" @@ -202,34 +151,48 @@ } } }, - "ticket|priority": { + "ticket|requester_name": { + "type": "text", + "index": 6, + "label": "Requester Name", + "tooltip": "The name of the requester. Example: Pablo." + }, + "ticket|requester_email": { + "type": "text", + "index": 7, + "label": "Requester Email", + "tooltip": "The email address of the requester. Example: pablito@example.org." + }, + "ticket|comment|body_format": { "type": "select", "index": 8, - "label": "Priority", - "tooltip": "The urgency with which the ticket should be addressed.", - "defaultValue": "normal", + "label": "Comment Format", + "tooltip": "The format of the comment.", "options": [ - { - "content": "urgent", - "value": "urgent" - }, - { - "content": "high", - "value": "high" - }, - { - "content": "normal", - "value": "normal" - }, - { - "content": "low", - "value": "low" - } + { "value": "text", "content": "Text or Markdown" }, + { "value": "html", "label": "HTML" } ] }, + "ticket|comment|body": { + "type": "textarea", + "index": 9, + "label": "Comment" + }, + "ticket|comment|public": { + "type": "toggle", + "index": 10, + "label": "Is Comment Public", + "tooltip": "Set if the comment should be public." + }, + "ticket|tags": { + "type": "textarea", + "index": 11, + "label": "Tags", + "tooltip": "A comma separated list of tags applied to this ticket." + }, "ticket|status": { "type": "select", - "index": 9, + "index": 12, "label": "Status", "tooltip": "The state of the ticket.", "defaultValue": "new", @@ -260,15 +223,9 @@ } ] }, - "ticket|tags": { - "type": "textarea", - "index": 10, - "label": "Tags", - "tooltip": "A comma separated list of tags applied to this ticket." - }, "ticket|type": { "type": "select", - "index": 11, + "index": 13, "label": "Type", "tooltip": "The type of this ticket.", "defaultValue": "incident", @@ -291,12 +248,55 @@ } ] }, + "ticket|priority": { + "type": "select", + "index": 14, + "label": "Priority", + "tooltip": "The urgency with which the ticket should be addressed.", + "defaultValue": "normal", + "options": [ + { + "content": "urgent", + "value": "urgent" + }, + { + "content": "high", + "value": "high" + }, + { + "content": "normal", + "value": "normal" + }, + { + "content": "low", + "value": "low" + } + ] + }, + "ticket|email_ccs": { + "type": "text", + "index": 15, + "label": "Email CCs", + "tooltip": "A comma separated list of email addresses to send email notification about the ticket creation to. Example: john@example.com,bob@example.com." + }, + "ticket|due_at": { + "type": "date-time", + "index": 16, + "label": "Task Due At", + "tooltip": "If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format.
JSON array. Example: \"1933-02-07T05:09:11.0Z\"." + }, + "ticket|external_id": { + "type": "text", + "index": 17, + "label": "External Id", + "tooltip": "An id you can use to link Zendesk Support tickets to local records." + }, "ticket|attachments": { "type": "expression", "group": "transformation", "label": "Attachments", "tooltip": "Attachments for the ticket.", - "index": 7, + "index": 18, "levels": [ "ADD" ], "fields": { "fileId": { diff --git a/src/appmixer/zendesktickets/tickets/DeleteTicket/component.json b/src/appmixer/zendesktickets/tickets/DeleteTicket/component.json index da67d961a..1a1e549aa 100644 --- a/src/appmixer/zendesktickets/tickets/DeleteTicket/component.json +++ b/src/appmixer/zendesktickets/tickets/DeleteTicket/component.json @@ -1,8 +1,7 @@ { - "version": "3.0.0", "name": "appmixer.zendesktickets.tickets.DeleteTicket", "author": "Appmixer ", - "description": "Delete Ticket.", + "description": "Delete an existing ticket.", "private": false, "quota": {}, "inPorts": [ @@ -19,7 +18,7 @@ "inputs": { "ticket_id": { "type": "number", - "index": 0, + "index": 1, "label": "Ticket ID", "tooltip": "The ID of the ticket to delete." } diff --git a/src/appmixer/zendesktickets/tickets/FindTicketComments/FindTicketComments.js b/src/appmixer/zendesktickets/tickets/FindTicketComments/FindTicketComments.js index f7be79b2a..e5b1c80d1 100644 --- a/src/appmixer/zendesktickets/tickets/FindTicketComments/FindTicketComments.js +++ b/src/appmixer/zendesktickets/tickets/FindTicketComments/FindTicketComments.js @@ -261,8 +261,7 @@ module.exports = { } } } - } - , + }, "example": { "content_type": "image/png", "content_url": "https://company.zendesk.com/attachments/my_funny_profile_pic.png", diff --git a/src/appmixer/zendesktickets/tickets/FindTickets/component.json b/src/appmixer/zendesktickets/tickets/FindTickets/component.json index 3a82f1163..6d330b78f 100644 --- a/src/appmixer/zendesktickets/tickets/FindTickets/component.json +++ b/src/appmixer/zendesktickets/tickets/FindTickets/component.json @@ -25,7 +25,7 @@ "outputType": { "type": "select", "label": "Output Type", - "index": 7, + "index": 2, "defaultValue": "first", "tooltip": "Choose whether you want to receive the tickets as one complete list, or one ticket at a time or a CSV file with all tickets found.", "options": [ diff --git a/src/appmixer/zendesktickets/tickets/UpdateTicket/UpdateTicket.js b/src/appmixer/zendesktickets/tickets/UpdateTicket/UpdateTicket.js index 77a384f7a..b2350a45a 100644 --- a/src/appmixer/zendesktickets/tickets/UpdateTicket/UpdateTicket.js +++ b/src/appmixer/zendesktickets/tickets/UpdateTicket/UpdateTicket.js @@ -74,8 +74,8 @@ module.exports = { } if (input['ticket|attachments']) { const fileIds = (input['ticket|attachments'].ADD || []) - .map(attachment => (attachment.fileId || null)) - .filter(fileId => fileId !== null); + .map(attachment => (attachment.fileId || null)) + .filter(fileId => fileId !== null); for (const fileId of fileIds) { const { data } = await this.uploadFile(context, fileId); requestBody.ticket.comment.uploads = requestBody.ticket.comment.uploads || []; diff --git a/src/appmixer/zendesktickets/tickets/UpdateTicket/component.json b/src/appmixer/zendesktickets/tickets/UpdateTicket/component.json index dc1cd66d3..ad4355453 100644 --- a/src/appmixer/zendesktickets/tickets/UpdateTicket/component.json +++ b/src/appmixer/zendesktickets/tickets/UpdateTicket/component.json @@ -112,83 +112,31 @@ }, "ticket|subject": { "type": "text", - "index": 1, + "index": 2, "label": "Subject", "tooltip": "The value of the subject field for this ticket." }, - "ticket|comment|body_format": { - "type": "select", - "index": 2, - "label": "New Comment Format", - "tooltip": "The format of the new comment that will be added to the ticket.", - "options": [ - { "value": "text", "content": "Text or Markdown" }, - { "value": "html", "label": "HTML" } - ] - }, - "ticket|comment|public": { - "type": "toggle", - "index": 3, - "label": "Is The New Comment Public", - "tooltip": "Set if the new comment should be public." - }, - "ticket|comment|body": { - "type": "textarea", - "index": 2, - "label": "New Comment", - "tooltip": "The body of the new comment that will be added to the ticket." - }, "ticket|assignee_email": { "type": "text", "index": 3, "label": "Assignee Email", "tooltip": "The email address of the agent to assign the ticket to. Example: john@example.com." }, - "ticket|requester_name": { - "type": "text", - "index": 3, - "label": "Requester Name", - "tooltip": "The name of the requester. Example: Pablo." - }, - "ticket|requester_email": { - "type": "text", - "index": 3, - "label": "Requester Email", - "tooltip": "The email address of the requester. Example: pablito@example.org." - }, - "ticket|email_ccs": { - "type": "text", - "index": 3, - "label": "Email CCs", - "tooltip": "A comma separated list of email addresses to send email notification about the ticket creation to. Example: john@example.com,bob@example.com." - }, "ticket|collaborator_emails": { "type": "text", - "index": 3, + "index": 4, "label": "Collaborator Emails", "tooltip": "A comma separated list of email addresses of collaborators. Example: john@example.com,bob@example.com." }, - "ticket|due_at": { - "type": "date-time", - "index": 4, - "label": "Task Due At", - "tooltip": "If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format.
JSON array. Example: \"1933-02-07T05:09:11.0Z\"." - }, - "ticket|external_id": { - "type": "text", - "index": 5, - "label": "External Id", - "tooltip": "An id you can use to link Zendesk Support tickets to local records." - }, - "ticket|group_id": { + "ticket|organization_id": { "type": "select", - "index": 6, - "label": "Group ID", - "tooltip": "The group this ticket is assigned to.", + "index": 5, + "label": "Organization ID", + "tooltip": "The organization of the requester. You can only specify the ID of an organization associated with the requester.", "source": { - "url": "/component/appmixer/zendesktickets/groups/FindGroups?outPort=out", + "url": "/component/appmixer/zendesktickets/organizations/FindOrganizations?outPort=out", "data": { - "transform": "./FindGroups#toSelectArray", + "transform": "./FindOrganizations#toSelectArray", "messages": { "in/query": "name:*", "in/outputType": "array" @@ -196,15 +144,15 @@ } } }, - "ticket|organization_id": { + "ticket|group_id": { "type": "select", - "index": 7, - "label": "Organization ID", - "tooltip": "The organization of the requester. You can only specify the ID of an organization associated with the requester.", + "index": 6, + "label": "Group ID", + "tooltip": "The group this ticket is assigned to.", "source": { - "url": "/component/appmixer/zendesktickets/organizations/FindOrganizations?outPort=out", + "url": "/component/appmixer/zendesktickets/groups/FindGroups?outPort=out", "data": { - "transform": "./FindOrganizations#toSelectArray", + "transform": "./FindGroups#toSelectArray", "messages": { "in/query": "name:*", "in/outputType": "array" @@ -212,34 +160,49 @@ } } }, - "ticket|priority": { - "type": "select", + "ticket|requester_name": { + "type": "text", + "index": 7, + "label": "Requester Name", + "tooltip": "The name of the requester. Example: Pablo." + }, + "ticket|requester_email": { + "type": "text", "index": 8, - "label": "Priority", - "tooltip": "The urgency with which the ticket should be addressed.", - "defaultValue": "normal", + "label": "Requester Email", + "tooltip": "The email address of the requester. Example: pablito@example.org." + }, + "ticket|comment|body_format": { + "type": "select", + "index": 9, + "label": "New Comment Format", + "tooltip": "The format of the new comment that will be added to the ticket.", "options": [ - { - "content": "urgent", - "value": "urgent" - }, - { - "content": "high", - "value": "high" - }, - { - "content": "normal", - "value": "normal" - }, - { - "content": "low", - "value": "low" - } + { "value": "text", "content": "Text or Markdown" }, + { "value": "html", "label": "HTML" } ] }, + "ticket|comment|body": { + "type": "textarea", + "index": 10, + "label": "New Comment", + "tooltip": "The body of the new comment that will be added to the ticket." + }, + "ticket|comment|public": { + "type": "toggle", + "index": 11, + "label": "Is The New Comment Public", + "tooltip": "Set if the new comment should be public." + }, + "ticket|tags": { + "type": "textarea", + "index": 12, + "label": "Tags", + "tooltip": "A comma separated list of tags applied to this ticket." + }, "ticket|status": { "type": "select", - "index": 9, + "index": 13, "label": "Status", "tooltip": "The state of the ticket.", "defaultValue": "new", @@ -270,15 +233,9 @@ } ] }, - "ticket|tags": { - "type": "textarea", - "index": 10, - "label": "Tags", - "tooltip": "A comma separated list of tags applied to this ticket." - }, "ticket|type": { "type": "select", - "index": 11, + "index": 14, "label": "Type", "tooltip": "The type of this ticket.", "defaultValue": "incident", @@ -301,12 +258,55 @@ } ] }, + "ticket|priority": { + "type": "select", + "index": 15, + "label": "Priority", + "tooltip": "The urgency with which the ticket should be addressed.", + "defaultValue": "normal", + "options": [ + { + "content": "urgent", + "value": "urgent" + }, + { + "content": "high", + "value": "high" + }, + { + "content": "normal", + "value": "normal" + }, + { + "content": "low", + "value": "low" + } + ] + }, + "ticket|email_ccs": { + "type": "text", + "index": 16, + "label": "Email CCs", + "tooltip": "A comma separated list of email addresses to send email notification about the ticket creation to. Example: john@example.com,bob@example.com." + }, + "ticket|due_at": { + "type": "date-time", + "index": 17, + "label": "Task Due At", + "tooltip": "If this is a ticket of type \"task\" it has a due date. Due date format uses ISO 8601 format.
JSON array. Example: \"1933-02-07T05:09:11.0Z\"." + }, + "ticket|external_id": { + "type": "text", + "index": 18, + "label": "External Id", + "tooltip": "An id you can use to link Zendesk Support tickets to local records." + }, "ticket|attachments": { "type": "expression", "group": "transformation", "label": "Attachments", "tooltip": "Attachments for the ticket.", - "index": 7, + "index": 19, "levels": [ "ADD" ], "fields": { "fileId": { diff --git a/src/appmixer/zendesktickets/tickets/WatchTickets/component.json b/src/appmixer/zendesktickets/tickets/WatchTickets/component.json index 2d58a5811..e99b55f98 100644 --- a/src/appmixer/zendesktickets/tickets/WatchTickets/component.json +++ b/src/appmixer/zendesktickets/tickets/WatchTickets/component.json @@ -28,7 +28,7 @@ "type": "select", "label": "Update Type", "description": "Detect either new or updated tickets.", - "index": 0, + "index": 1, "options": [ { "label": "Created", "value": "Create" }, { "label": "Changed", "value": "Change" } @@ -38,7 +38,7 @@ "type": "expression", "label": "Type Condition", "description": "Filter tickets by type condition.", - "index": 1, + "index": 2, "levels": ["ADD"], "fields": { "operator": { @@ -65,7 +65,7 @@ "type": "expression", "label": "Status Condition", "description": "Filter tickets by status condition.", - "index": 1, + "index": 3, "levels": ["ADD"], "fields": { "operator": { @@ -96,7 +96,7 @@ "type": "expression", "label": "Priority Condition", "description": "Filter tickets by priority condition.", - "index": 1, + "index": 4, "levels": ["ADD"], "fields": { "operator": { diff --git a/src/appmixer/zendesktickets/users/FindUsers/component.json b/src/appmixer/zendesktickets/users/FindUsers/component.json index 8f6d0ca9d..eeb31a568 100644 --- a/src/appmixer/zendesktickets/users/FindUsers/component.json +++ b/src/appmixer/zendesktickets/users/FindUsers/component.json @@ -25,7 +25,7 @@ "outputType": { "type": "select", "label": "Output Type", - "index": 7, + "index": 2, "defaultValue": "first", "tooltip": "Choose whether you want to receive the users as one complete list, or one user at a time or a CSV file with all users found.", "options": [ diff --git a/src/appmixer/zendesktickets/users/WatchUsers/component.json b/src/appmixer/zendesktickets/users/WatchUsers/component.json index f6748ea36..95498362a 100644 --- a/src/appmixer/zendesktickets/users/WatchUsers/component.json +++ b/src/appmixer/zendesktickets/users/WatchUsers/component.json @@ -24,7 +24,7 @@ "type": "multiselect", "label": "Event Types", "description": "Select one or more event types to watch for.", - "index": 0, + "index": 1, "options": [ { "label": "User Created", "value": "zen:event-type:user.created" }, { "label": "User Deleted", "value": "zen:event-type:user.deleted" },