:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse-sources): add moxie tasks, tickets and agreements tables (#123045)
Tom Owers0e4b01501df5
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex e29f47de6b80..2da898b9729e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -8237,10 +8237,10 @@ Today (11): `clients`, `contacts`, `email_templates`, `form_names`, `invoice_temDiffed against: <https://api-docs.withmoxie.com/sitemap.xml>-- [ ] `List tasks (GET /public/action/tasks/list)` — analyze project workload, task completion, and status distributions beyond the synced project summaries (high)-- [ ] `getCustomFields (GET /public/api/customFields)` — interpret customValues on synced client and project records with the workspace field definitions (high)-- [ ] `Search Agreements (GET /public/action/agreements/search)` — measure agreement completion, signature status, and contract lifecycle by client (medium)-- [ ] `List tickets (GET /public/action/tickets/list)` — analyze customer support workload and ticket states alongside synced clients and projects (medium)+- [x] `List tasks (GET /public/action/tasks/list)` — analyze project workload, task completion, and status distributions beyond the synced project summaries (high). Added as `tasks`.+- ~~`getCustomFields (GET /public/api/customFields)` — interpret customValues on synced client and project records with the workspace field definitions (high)~~ — skipped: it is a Zapier hook endpoint that needs a `type` value the spec does not document, and it returns only key and label pairs, not the field definitions+- [x] `Search Agreements (GET /public/action/agreements/search)` — measure agreement completion, signature status, and contract lifecycle by client (medium). Added as `agreements`.+- [x] `List tickets (GET /public/action/tickets/list)` — analyze customer support workload and ticket states alongside synced clients and projects (medium). Added as `tickets`.Note: Followed the retired help collection to the current reference, then read collection operations listed in its sitemap. Current paths use /public/action or /public/api, so the configured workspace base URL must have the matching prefix. These gaps do not require parent enumeration. Excluded write-only time, expense, invoice, payment, and opportunity operations, plus configuration templates.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/canonical_descriptions.pyindex 34526dc2ec58..95ed80c14c5c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/canonical_descriptions.py@@ -162,6 +162,67 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"clientApproval": "Whether tasks in this stage require client approval.",},},+ "tasks": {+ "description": "A task (deliverable) on a project, with its status, assignees, and dates.",+ "docs_url": "https://api-docs.withmoxie.com/api/list-tasks",+ "columns": {+ "id": "Unique identifier for the task.",+ "clientId": "ID of the client the task belongs to.",+ "projectId": "ID of the project the task belongs to.",+ "parentTaskId": "ID of the parent task when this task is a subtask.",+ "name": "Task name.",+ "statusId": "ID of the task stage the task is in.",+ "status": "Name of the task stage the task is in.",+ "description": "Task description.",+ "assignedToList": "User IDs the task is assigned to.",+ "customValues": "Values of the workspace's custom fields for this task.",+ "startDate": "Date the task starts.",+ "dueDate": "Date the task is due.",+ "created": "Time the task was created.",+ "completed": "Time the task was completed.",+ "archived": "Whether the task has been archived.",+ "isSubTask": "Whether the task is a subtask of another task.",+ },+ },+ "tickets": {+ "description": "A client support ticket, with its state, assignees, and timeline.",+ "docs_url": "https://api-docs.withmoxie.com/api/list-tickets",+ "columns": {+ "id": "Unique identifier for the ticket.",+ "clientId": "ID of the client the ticket belongs to.",+ "clientContactId": "ID of the client contact who raised the ticket.",+ "ticketNumber": "Sequential ticket number in the workspace.",+ "assignedTo": "User IDs the ticket is assigned to.",+ "dueDate": "Date the ticket is due.",+ "subject": "Ticket subject.",+ "open": "Whether the ticket is open.",+ "type": "Ticket type.",+ "status": "Ticket status.",+ "created": "Time the ticket was created.",+ "updated": "Time the ticket was last updated.",+ "closed": "Time the ticket was closed.",+ "snoozedUntil": "Time until which the ticket is snoozed.",+ "archived": "Whether the ticket has been archived.",+ "client": "The client the ticket belongs to, embedded.",+ },+ },+ "agreements": {+ "description": "An agreement (contract or proposal) sent to a client, with its signature status.",+ "docs_url": "https://api-docs.withmoxie.com/api/search-agreements",+ "columns": {+ "id": "Unique identifier for the agreement.",+ "name": "Agreement name.",+ "client": "The client the agreement was sent to, embedded.",+ "status": "Agreement status.",+ "statusTime": "Time the agreement entered its current status.",+ "currency": "Currency of the agreement.",+ "dateCreated": "Time the agreement was created.",+ "dateCompleted": "Time the agreement was completed.",+ "fullyExecuted": "Whether every party has signed the agreement.",+ "userSigned": "Whether the workspace user has signed the agreement.",+ "clientSigned": "Whether the client has signed the agreement.",+ },+ },"workspace_users": {"description": "A user in the workspace, with their role, project access, and feature access.","docs_url": "https://help.withmoxie.com/en/articles/8260260-list-workspace-users",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/settings.pyindex 3986df6375c0..10772b98116f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/settings.py@@ -74,6 +74,14 @@ MOXIE_ENDPOINTS: dict[str, MoxieEndpointConfig] = {),"pipeline_stages": MoxieEndpointConfig(name="pipeline_stages", path=f"{MOXIE_API_PATH_PREFIX}/pipelineStages/list"),"task_stages": MoxieEndpointConfig(name="task_stages", path=f"{MOXIE_API_PATH_PREFIX}/taskStages/list"),+ # List Tasks and List Tickets default to `archived=false`, so archived records are not synced.+ "tasks": MoxieEndpointConfig(name="tasks", path=f"{MOXIE_API_PATH_PREFIX}/tasks/list", partition_key="created"),+ "tickets": MoxieEndpointConfig(+ name="tickets", path=f"{MOXIE_API_PATH_PREFIX}/tickets/list", partition_key="created"+ ),+ "agreements": MoxieEndpointConfig(+ name="agreements", path=f"{MOXIE_API_PATH_PREFIX}/agreements/search", partition_key="dateCreated"+ ),# Rows are keyed by the nested `user.userId`, flattened onto the row root as `user_id` (see# `moxie.py`) since a nested field can't be declared as a primary key."workspace_users": MoxieEndpointConfig(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/tests/test_moxie.py b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/tests/test_moxie.pyindex c3e4e2e878f8..22f4341fb75b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/tests/test_moxie.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/moxie/tests/test_moxie.py@@ -47,6 +47,22 @@ class TestMoxieTransport:assert result.raised is Noneassert result.items == [[{"name": "Template A"}, {"name": "Template B"}]]+ @pytest.mark.parametrize(+ "endpoint, path",+ [+ ("tasks", "/api/public/action/tasks/list"),+ ("tickets", "/api/public/action/tickets/list"),+ ("agreements", "/api/public/action/agreements/search"),+ ],+ )+ def test_object_endpoints_request_documented_path_and_pass_rows_through(self, endpoint: str, path: str) -> None:+ row = {"id": "abc123", "created": "2024-01-02T03:04:05Z"}+ result = _driver().run(endpoint, [ScriptedResponse(json=[row])])++ assert result.raised is None+ assert result.paths == [path]+ assert result.items == [[row]]+def test_workspace_users_flattens_nested_user_id(self) -> None:row = {"userType": "OWNER", "user": {"userId": 42, "firstName": "Alex"}}result = _driver().run("workspace_users", [ScriptedResponse(json=[row])])