n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
45.48k stars 6.25k forks source link

Zammad: Additional fields are not used when creating a ticket #9807

Open envy opened 2 months ago

envy commented 2 months ago

Bug Description

We tried to use the Zammad node to create a ticket in our self hosted zammad.

Since we use a bot user, the article in the ticket is assigned to the bot user. We tried adding an additional field named reply_to so that the articles reply-to address is set to the correct email address but this did not work.

I looked at the code for the node and noticed that the additional fields are never read in the ticket creation path.

Furthermore, it's a bit ambigious if those additional fields should be added to the ticket data or the article data. Essentially, you would need two additional field sets, one for the actual ticket and one for the article as you might also need to add a custom field to the ticket data (I actually need to do that).

To Reproduce

  1. Create a zammad node.
  2. Add some additional fields.
  3. Fields are neither added to the ticket JSON nor the article JSON

Expected behavior

Additional fields are either added to the ticket or article.

But actually, two additional field sets are needed, one for the ticket and one for the article, that add to the respective JSON data.

Operating System

whatever runs on n8n.cloud

n8n Version

whatever runs on n8n.cloud (seems to be 1.44.1?)

Node.js Version

whatever runs on n8n.cloud

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 2 months ago

Hey @envy,

I have just taken a look and it looks like the Article fields are correctly added and this is only an issue with Additional fields, I have created an internal ticket to resolve this which we are tracking internally as NODE-1428

envy commented 2 months ago

Hi,

yes, the article fields are added correctly, it's just the additional fields that are not added. Also please consider enhancing this to two sets of additional fields (or make it possible to specify where each custom field should be added) so that it's possible to add field to both the ticket and the article independently.

Joffcom commented 2 months ago

Hey @envy,

Do articles support custom fields when creating tickets? From what I can see in our Zammad instance and the API docs it is only an option for Tickets, Users, Organizations and Groups.

Can you be more specific on the article fields you want to add?

envy commented 2 months ago

Hi,

Oh I see, "custom field" is meant to be an actual zammad custom field. I interpreted that as "any field you want to add to the JSON".

Let me show you the resulting JSON I want to create:

{
  "title": "some title",
  "group": "some group",
  "customer": "some@customer.tld",
  "my_custom_zammad_field": "some value",
  "article": {
    "subject": "some subject",
    "body": "body",
    "type": "email",
    "internal": false,
    "content_type": "text/plain",
    "sender": "Customer",
    "reply_to": "some@customer.tld",
  }
}

The additional fields would be then be able to add the my_custom_zammad_field. However, we also need the content_type, sender and reply_to field for article. I thought that I could add them also using additional fields but I see that I understood that wrong.

Joffcom commented 2 months ago

Hey @envy,

Perfect, We would probably treat the extra article fields as a different request as it is a feature not a bug so for this issue we will only address the missing custom fields for now.