Skip to main content

Professional ClickUp task automation with state sync.

Project description

ClickFlow-Sync 🚀

ClickFlow-Sync is a professional, idempotent Python engine designed to bridge external data sources (Vulnerability Scanners, Monitoring Tools, or CI/CD pipelines) with ClickUp. Unlike a simple API wrapper, ClickFlow-Sync manages state. It ensures that if a scanner finds the same issue multiple times, it updates the existing ClickUp task instead of creating annoying duplicates.

📦 Installation

1. Clone the repository:

git clone https://github.com/jenilmistryhq/ClickFlow-Sync.git
cd ClickFlow-Sync

2. Install Dependencies:

pip install -r requirements.txt

⚙ Configuration (.env)

Create a .env file in your project root to manage credentials securely:

# ClickUp Configuration
CLICKUP_API_KEY=pk_your_api_key_here
CLICKUP_LIST_ID=123456789012
CLICKUP_DEFAULT_ASSIGNEE=1234567,8901234
# Slack Configuration (Optional)
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T000/B000/XXXX

🛠 Usage Patterns

ClickFlow-Sync is designed to be a "plug-and-play" package. You do not need to modify the core src/ files.

1. Smart Integration (With Slack & Member Mapping)

This is the recommended way to use the package. It allows you to map IDs to real names and departments.

from src.engine import ClickFlowEngine
from src.models import ClickUpTask
from src.slack_plugin import SlackPlugin

# 1. Map ClickUp IDs to Human Names and Departments
MEMBER_DATA = {
    1234567: {"name": "Jack", "dept": "Security Engineering"},
    8901234: {"name": "Alice", "dept": "DevOps"}
}

# 2. Setup Tools
engine = ClickFlowEngine()
slack = SlackPlugin(member_info=MEMBER_DATA)

# 3. Define the Task
task = ClickUpTask(
    internal_id="SCAN-2025-001", 
    title="[CRITICAL] SQL Injection Detected",
    description="Found on /api/login endpoint.",
    priority=1,
    category="security",
    tags=["automated-scan"]
)

# 4. Sync & Notify
# This will update ClickUp AND send a rich notification
engine.upsert_task(task, callback=slack.send_notification)

🎨 Customization

  • Clean Output Logic: The engine uses "Smart Filtering." If a field like tags, priority, or description is empty, it is

  • Automatically hidden: from both the local terminal preview and the Slack message to keep notifications clean.

  • Local Testing (No Slack Required): If you haven't added a SLACK_WEBHOOK_URL yet, the engine will still work! It will print a beautiful, human-readable Local Notification Preview to your terminal so you can verify the data before going live.

  • Custom Message Formatting: You can bypass the default Slack look by passing your own formatter function: def my_mini_style(task, clickup_id, action):

def my_mini_style(task, clickup_id, action):
    return {"text": f"🚀 {action}: {task.title} (ID: {clickup_id})"}

engine.upsert_task(task, callback=lambda t, cid, act: 
    slack.send_notification(t, cid, act, custom_formatter=my_mini_style)
)

🏗 Architecture & State

ClickFlow-Sync creates a sync_state.json file to track tasks.

Creation: If an internal_id is new, a task is created.

Update: If the internal_id exists, it performs a PUT request to update the task.

Auto-Recovery: If a task is manually deleted in ClickUp, the engine detects the error, clears the local state, and automatically re-creates the task on the next run.

📝 Data Model (ClickUpTask)

| Field           | Type | Default    | Description                                                     |
|-----------------|------|------------|-----------------------------------------------------------------|
| internal_id     | str  | Required   | Unique ID from your source (e.g., CVE ID).                      |
| title           | str  | Required   | The ClickUp task name.                                          |
| description     | str  | ""         | The task body / content.                                       |
| category        | str  | "general"  | Matches keys in your Team Map for auto-assignment.              |
| priority        | int  | None       | 1 (Urgent), 2 (High), 3 (Normal), 4 (Low).                      |
| tags            | list | []         | List of strings for ClickUp tags.                               |
| target_list_id  | str  | None       | Override the default list for specific tasks.                   |

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clickflow_sync-1.2.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clickflow_sync-1.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file clickflow_sync-1.2.0.tar.gz.

File metadata

  • Download URL: clickflow_sync-1.2.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for clickflow_sync-1.2.0.tar.gz
Algorithm Hash digest
SHA256 587e0f9ea43beea3f022a903b1d62b35212d02a4de826827f4eadca71eca87d4
MD5 e4d2b5a597a17c3d1881f7c3ec952b24
BLAKE2b-256 a7bc4d908f64951be256d177ef3f779349cd059830b7b3461d29a76cc7618b32

See more details on using hashes here.

File details

Details for the file clickflow_sync-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: clickflow_sync-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for clickflow_sync-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd4554d71398b02cebf63b511ccb788e75ae79925e4285de1b41c3a28b929fd
MD5 45d9d169f68dff982ca94054cb278cf6
BLAKE2b-256 59fcff4d0143b487565e5b0e47ef77c7d9f23f433477158fc838f93865a90933

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page