Group items from JSON

Describe the problem/error/question

I have a JSON containing all services we offer to all customers including their next maintenance date. I now want to group the items by service and create tickets in Jira for each service group. Here’s an example JSON:

[
  {
    "Id": 1,
    "CreatedAt": "2025-02-20 15:59:43+00:00",
    "UpdatedAt": "2025-04-07 12:39:31+00:00",
    "Services_id": 1,
    "Services": {
      "Id": 1,
      "Service": "Domäne"
    },
    "Wartungsfenster": {
      "Id": 2,
      "rrule beschreibung": "Monthly on the the 4th occurrence(s) of [Sunday]"
    }
  },
  {
    "Id": 2,
    "CreatedAt": "2025-02-20 15:59:43+00:00",
    "UpdatedAt": "2025-04-07 12:39:31+00:00",
    "Services_id": 1,
    "Services": {
      "Id": 1,
      "Service": "Domäne"
    },
    "Wartungsfenster": {
      "Id": 2,
      "rrule beschreibung": "Monthly on the the 4th occurrence(s) of [Sunday]"
    }
  },
  {
    "Id": 3,
    "CreatedAt": "2025-02-20 15:59:43+00:00",
    "UpdatedAt": "2025-04-07 12:39:31+00:00",
    "Services_id": 1,
    "Services": {
      "Id": 1,
      "Service": "Clients"
    },
    "Wartungsfenster": {
      "Id": 2,
      "rrule beschreibung": "Monthly on the the 4th occurrence(s) of [Sunday]"
    }
  }
]

I want to group the objects by the key Services.Service so the result looks something like this:

[
  {
    "group": "Domäne" : {
      all data from all the objects from that group
      },
    "group":"Clients": {
      all data from all the objects from that group
      }
  }
]

For each group then I want to run a jira automation to create issues.
Any idea how I can achieve this with as little code as possible? Was trying the Summarize and aggregate node but wasn’t successful…

Information on your n8n setup

Debug info

core

  • n8nVersion: 1.85.4
  • platform: docker (self-hosted)
  • nodeJsVersion: 20.18.3
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
1 Like

Hi @thejokeregg,

Try this workflow. It aggregates into two items.

Best,

Robert

Hey Robert, thank you! It does only create on group named Domäne and ignores everything else. I actually got very similar code using gemini. I was hoping to be able to do it with n8n data transformation nodes so my colleagues can support this automation as well. If you or someone else has an idea to do this efficiently please let me know. If a code node is recommended anyway I’ll find my way around.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.