{
  "schema_version": "1.0.0",
  "id": "slack-task-line-to-notion-clickup",
  "title": "Turn a Slack task line into Notion and ClickUp",
  "category": "ops",
  "difficulty": "intermediate",
  "featured": true,
  "description": "Parse a one-line task posted in a Slack channel into title, owner, project, priority, and due date, then file it in Notion and ClickUp.",
  "tags": [
    "slack",
    "notion",
    "clickup",
    "tasks",
    "ops"
  ],
  "apps": [
    "Slack",
    "Formatter by Zapier",
    "Code by Zapier",
    "Notion",
    "ClickUp"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Formatter by Zapier"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Slack",
    "event": "New Message Posted to Channel",
    "kind": "instant",
    "title": "New message in #tasks",
    "why": "Fires for every human message in one dedicated #tasks channel. A separate channel keeps chatter out of the task list.",
    "config": {
      "Channel": "#tasks",
      "Trigger for Bot Messages?": "No"
    },
    "outputs": [
      "ts",
      "text",
      "user_name",
      "user_id",
      "channel_name",
      "permalink"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "today",
      "kind": "formatter",
      "app": "Formatter by Zapier",
      "event": "Date / Time",
      "title": "Get today's date for the team",
      "why": "Due words like \"fri\" and \"tomorrow\" need a reference date. This turns the Zap's run time into YYYY-MM-DD in your own time zone.",
      "fields": {
        "Transform": "Format",
        "Input": "{{meta.human_now}}",
        "To Format": "YYYY-MM-DD",
        "To Timezone": "YOUR_TIMEZONE",
        "From Timezone": "UTC"
      },
      "outputs": [
        "output"
      ]
    },
    {
      "key": "parse",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Read owner, project, priority, and due date",
      "why": "Pulls @owner, #project, !priority, and due:fri out of the line and returns a clean title. Lines without a date are still filed, just without one.",
      "code": {
        "language": "javascript",
        "module": "task-line",
        "file": "code/task-line.js"
      },
      "input_data": {
        "text": "{{trigger.text}}",
        "today": "{{today.output}}",
        "default_project": "ops"
      },
      "outputs": [
        "title",
        "owner",
        "project",
        "priority",
        "due_date",
        "has_due"
      ]
    },
    {
      "key": "notion",
      "kind": "action",
      "app": "Notion",
      "event": "Create Database Item",
      "title": "Log the task in the Notion project log",
      "why": "Notion keeps the record of what was asked, by whom, and the link back to the Slack message.",
      "fields": {
        "Database": "YOUR_NOTION_TASK_LOG",
        "Name": "{{parse.title}}",
        "Owner": "{{parse.owner}}",
        "Project": "{{parse.project}}",
        "Priority": "{{parse.priority}}",
        "Due date": "{{parse.due_date}}",
        "Asked by": "{{trigger.user_name}}",
        "Slack link": "{{trigger.permalink}}"
      },
      "outputs": [
        "id",
        "url"
      ]
    },
    {
      "key": "clickup",
      "kind": "action",
      "app": "ClickUp",
      "event": "Create Task",
      "title": "Create the ClickUp task",
      "why": "The working copy goes to ClickUp, where the owner sees it in their own task list. The description links both the Slack message and the Notion entry.",
      "fields": {
        "Workspace": "YOUR_CLICKUP_WORKSPACE",
        "Space": "Operations",
        "List": "Inbox",
        "Task Name": "{{parse.title}}",
        "Priority": "{{parse.priority}}",
        "Due Date": "{{parse.due_date}}",
        "Tags": "{{parse.project}}",
        "Description": "Asked by {{trigger.user_name}} in Slack: {{trigger.permalink}}\nOwner named: {{parse.owner}}\nNotion log: {{notion.url}}"
      },
      "outputs": [
        "id",
        "url"
      ]
    }
  ]
}
