CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-django-crm

Open Source CRM developed on Django framework with REST API for contact, lead, account, and opportunity management

Overview
Eval results
Files

cases.mddocs/

Case Management

Support case tracking and management system with priority levels, case types, status management, resolution tracking, and integration with accounts and contacts for comprehensive customer support.

Capabilities

Case Listing and Search

List and search cases with comprehensive filtering options.

def list_cases(name: str = None, status: str = None, priority: str = None,
               case_type: str = None, assigned_to: str = None, account: str = None,
               limit: int = 10, offset: int = 0) -> dict:
    """
    List cases with filtering and search.

    Args:
        name (str, optional): Filter by case name (partial match)
        status (str, optional): Filter by status ('New', 'In Progress', 'On Hold', 'Closed')
        priority (str, optional): Filter by priority level
        case_type (str, optional): Filter by case type
        assigned_to (str, optional): Filter by assigned user UUID
        account (str, optional): Filter by associated account UUID
        limit (int): Number of results per page (default: 10)
        offset (int): Number of results to skip (default: 0)

    Returns:
        dict: Paginated cases with metadata

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>

    Example:
        GET /api/cases/?status=In%20Progress&priority=High&limit=5

        Response:
        {
            "count": 8,
            "next": "/api/cases/?limit=5&offset=5",
            "previous": null,
            "results": [
                {
                    "id": "case-uuid",
                    "name": "Login Issues - ACME Corp",
                    "status": "In Progress",
                    "priority": "High",
                    "case_type": "Technical",
                    "account": "account-uuid",
                    "contacts": ["contact1-uuid"],
                    "created_on": "2023-01-15T10:30:00Z",
                    "closed_on": null,
                    "assigned_to": ["user1-uuid"],
                    "teams": ["team1-uuid"]
                }
            ]
        }
    """

Case Creation

Create new support cases with priority, type, and entity associations.

def create_case(case_data: dict) -> dict:
    """
    Create a new support case.

    Args:
        case_data (dict): Case information and associations

    Returns:
        dict: Created case details

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>
        Content-Type: multipart/form-data (if including attachments)

    Example:
        POST /api/cases/
        {
            "name": "Email Configuration Problem",
            "status": "New",
            "priority": "Normal",
            "case_type": "Technical",
            "account": "account-uuid",
            "contacts": ["contact1-uuid"],
            "assigned_to": ["user1-uuid"],
            "teams": ["support-team-uuid"]
        }

        Response:
        {
            "id": "new-case-uuid",
            "name": "Email Configuration Problem",
            "status": "New",
            "priority": "Normal",
            "case_type": "Technical",
            "created_on": "2023-02-01T09:00:00Z",
            ...case details...
        }
    """

Case Details and Operations

Get comprehensive case information and perform updates.

def get_case(pk: str) -> dict:
    """
    Get detailed case information.

    Args:
        pk (str): Case UUID

    Returns:
        dict: Complete case details with related entities

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>

    Example:
        GET /api/cases/case-uuid/

        Response:
        {
            "case_obj": {
                "id": "case-uuid",
                "name": "Login Issues - ACME Corp",
                "status": "In Progress",
                "priority": "High",
                "case_type": "Technical",
                "account": "account-uuid",
                "contacts": ["contact1-uuid"],
                "created_on": "2023-01-15T10:30:00Z",
                "closed_on": null,
                "created_by": "user-uuid"
            },
            "assigned_to": [...assigned users...],
            "teams": [...assigned teams...],
            "comments": [...case comments...],
            "attachments": [...case attachments...],
            "users_mention": [...users for @mentions...]
        }
    """

def update_case(pk: str, case_data: dict) -> dict:
    """
    Update case information.

    Args:
        pk (str): Case UUID
        case_data (dict): Updated case information

    Returns:
        dict: Updated case details

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>

    Example:
        PUT /api/cases/case-uuid/
        {
            "name": "Login Issues - RESOLVED",
            "status": "Closed",
            "closed_on": "2023-02-05T16:30:00Z"
        }
    """

def delete_case(pk: str) -> None:
    """
    Delete a case.

    Args:
        pk (str): Case UUID

    Returns:
        None: 204 No Content on success

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>

    Example:
        DELETE /api/cases/case-uuid/
    """

Case Comments and Attachments

Manage comments and file attachments for cases.

def add_case_comment_or_attachment(pk: str, comment: str = None,
                                 attachment: file = None) -> dict:
    """
    Add comment or attachment to case.

    Args:
        pk (str): Case UUID
        comment (str, optional): Comment text
        attachment (file, optional): File to attach

    Returns:
        dict: Success response

    Headers Required:
        Authorization: Bearer <access_token>
        organization-id: <org_uuid>
        Content-Type: multipart/form-data (for attachments)

    Example:
        POST /api/cases/case-uuid/
        {
            "comment": "Issue reproduced, working on solution"
        }
    """

def edit_case_comment(pk: str, comment: str) -> dict:
    """
    Edit a case comment.

    Args:
        pk (str): Comment UUID
        comment (str): Updated comment text

    Returns:
        dict: Updated comment

    Headers Required:
        Authorization: Bearer <access_token>

    Example:
        PUT /api/cases/comment/comment-uuid/
        {
            "comment": "Root cause identified - server configuration issue"
        }
    """

def delete_case_comment(pk: str) -> None:
    """
    Delete a case comment.

    Args:
        pk (str): Comment UUID

    Returns:
        None: 204 No Content on success

    Headers Required:
        Authorization: Bearer <access_token>

    Example:
        DELETE /api/cases/comment/comment-uuid/
    """

def delete_case_attachment(pk: str) -> None:
    """
    Delete a case attachment.

    Args:
        pk (str): Attachment UUID

    Returns:
        None: 204 No Content on success

    Headers Required:
        Authorization: Bearer <access_token>

    Example:
        DELETE /api/cases/attachment/attachment-uuid/
    """

Case Data Types

class Case:
    """Case model representing support cases and issues"""
    id: str  # UUID
    name: str  # Required case title/description
    status: str  # 'New', 'In Progress', 'On Hold', 'Closed'
    priority: str  # Priority level (e.g., 'Low', 'Normal', 'High', 'Critical')
    case_type: str  # Type of case (e.g., 'Technical', 'Billing', 'General')

    # Entity associations
    account: str  # Account UUID (optional)
    contacts: list[str]  # Contact UUIDs

    # Resolution tracking
    closed_on: datetime  # When case was closed (if applicable)

    # Metadata
    created_on: datetime
    created_by: str  # User UUID
    org: str  # Organization UUID

    # Assignments
    assigned_to: list[str]  # User UUIDs
    teams: list[str]  # Team UUIDs

class CaseComment:
    """Comments on cases"""
    id: str  # UUID
    comment: str
    case: str  # Case UUID
    commented_on: datetime
    commented_by: str  # User UUID

class CaseAttachment:
    """File attachments on cases"""
    id: str  # UUID
    attachment: str  # File path/URL
    case: str  # Case UUID
    created_on: datetime
    created_by: str  # User UUID

Case Status Management

Cases follow a standard support workflow with these status options:

  • New: Newly created case, not yet assigned or started
  • In Progress: Case is actively being worked on
  • On Hold: Case is temporarily paused (waiting for customer response, etc.)
  • Closed: Case has been resolved and closed

Case Priority Levels

Priority helps organize case urgency and response times:

  • Low: Minor issues that can be addressed during normal business hours
  • Normal: Standard priority issues for regular support workflow
  • High: Important issues that need prompt attention
  • Critical: Urgent issues requiring immediate response

Case Types

Cases can be categorized by type for better organization:

  • Technical: Technical support and troubleshooting
  • Billing: Billing questions and payment issues
  • General: General inquiries and information requests
  • Bug Report: Software bugs and system issues
  • Feature Request: Enhancement and feature requests

Search and Filtering

Cases support multiple search and filter options:

  • Name Search: name parameter for partial text matching
  • Status Filter: Filter by current case status
  • Priority Filter: Filter by case priority level
  • Type Filter: Filter by case type category
  • Assignment: assigned_to filtering by user UUID
  • Account Association: Filter cases related to specific accounts
  • Resolution Status: Filter by open vs. closed cases

All text-based filters support partial matching and are case-insensitive.

Related Entities

Cases can be associated with and relate to:

  • Accounts: Cases can be linked to customer accounts
  • Contacts: Associate cases with specific customer contacts
  • Teams: Assign cases to support teams
  • Users: Individual case assignments and ownership
  • Comments: Case progress updates and resolution notes
  • Attachments: Supporting documents, screenshots, and files

This makes cases central to customer support management and issue resolution tracking across the CRM system.

Install with Tessl CLI

npx tessl i tessl/pypi-django-crm

docs

accounts.md

authentication.md

cases.md

contacts.md

documents.md

events.md

index.md

invoices.md

leads.md

opportunities.md

tasks.md

teams.md

tile.json