Help - consolidate list for slack message

Hello! Im looking at getting a list of task that are assigned to a user in asana and have them sent a slack message with the Name and link

{
  "name": "Send Sah Update of Tasks",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        160,
        300
      ]
    },
    {
      "parameters": {
        "resource": "project",
        "id": "1201761980458020"
      },
      "name": "Asana",
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        660,
        300
      ],
      "credentials": {
        "asanaApi": {
          "id": "17",
          "name": "Asana account"
        }
      }
    },
    {
      "parameters": {
        "operation": "getAll",
        "filters": {
          "assignee": "1200829537695406",
          "opt_fields": [
            "name",
            "resource_type",
            "permalink_url",
            "completed"
          ],
          "workspace": "88855034380843",
          "completed_since": "2022-03-09T04:00:24.824Z"
        }
      },
      "name": "Asana1",
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        940,
        300
      ],
      "credentials": {
        "asanaApi": {
          "id": "17",
          "name": "Asana account"
        }
      }
    },
    {
      "parameters": {
        "channel": "personal-assistant-bot",
        "text": "=You have the following items outstanding on Asana: \n<{{$json[\"name\"].join(' /n ')}}|{{$json[\"permalink_url\"].join(' /n ')}}>\n\n{{$json[\"name\"].length}}",
        "jsonParameters": true,
        "attachments": [
          {
            "text": "{{$json[\"name\"]}}"
          }
        ],
        "otherOptions": {
          "icon_url": "https://i.ibb.co/6rv29LN/asana-logo.png",
          "link_names": true,
          "mrkdwn": true,
          "sendAsUser": "Asana Bot"
        },
        "attachmentsJson": "="
      },
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        1440,
        180
      ],
      "credentials": {
        "slackApi": {
          "id": "4",
          "name": "Slack account"
        }
      }
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "hour": 6
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        380,
        300
      ]
    },
    {
      "parameters": {
        "channel": "U02BP08GHV5",
        "text": "=You have the follow item outstanding on Asana: <{{$json[\"permalink_url\"]}}|{{$json[\"name\"]}}>",
        "attachments": [],
        "otherOptions": {
          "icon_url": "https://i.ibb.co/6rv29LN/asana-logo.png",
          "link_names": true,
          "mrkdwn": true,
          "sendAsUser": "Asana Bot"
        },
        "blocksUi": {
          "blocksValues": []
        }
      },
      "name": "Sah - Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        1480,
        480
      ],
      "credentials": {
        "slackApi": {
          "id": "4",
          "name": "Slack account"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "operation": "aggregateItems",
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "name"
            },
            {
              "fieldToAggregate": "permalink_url"
            }
          ]
        },
        "options": {}
      },
      "name": "Item Lists",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 1,
      "position": [
        1200,
        180
      ]
    }
  ],
  "connections": {
    "Asana": {
      "main": [
        [
          {
            "node": "Asana1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Asana1": {
      "main": [
        [
          {
            "node": "Sah - Slack",
            "type": "main",
            "index": 0
          },
          {
            "node": "Item Lists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cron": {
      "main": [
        [
          {
            "node": "Asana",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Item Lists": {
      "main": [
        [
          {
            "node": "Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": 23
}```

Looking it to look like this, where each task is also hyperlinks to its respective task

Hello, please see the tasks that are assigned to you:

  • Task 1
  • Task 2
  • Task 3

Hey @yelsew,

Welcome to the community :tada:

What you would need to do is use the function node to build out your message by looping over the inputs example. I have not tested it but the example worklfow below may do what you are after if not it should only need a bit of tweaking to get it right.

1 Like