Skip to content

: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.

feat(data-warehouse): add 4 missing tables to the ServiceNow source (#118940)

Tom Owers90469d4b2bf1
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.md
index a627603e86e9..5ab1569cdd8d 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
@@ -10793,10 +10793,10 @@ Today (13): `assets`, `catalog_requests`, `catalog_tasks`, `change_requests`, `c
Diffed against: <https://www.servicenow.com/docs/r/zurich/it-service-management/service-level-management/r_TaskSLATable.html (plus https://www.servicenow.com/docs/r/zurich/platform-administration/c_MetricInstance.html, .../system-localization/r_ChoicesTable.html, .../it-service-management/incident-management/itsm-incident-use-case.html)>
-- [ ] `task_sla (Task SLA table)` — SLA attachment, stage, breach time and elapsed percentage for every incident, change and requested item already synced — SLA attainment is the headline ITSM metric and is entirely absent (high)
-- [ ] `metric_instance (Metric instance table)` — Per-field duration records (time in each state, time per assignee) generated by the metric engine — the raw data behind MTTR and state-dwell analysis (high)
-- [ ] `sys_choice (Choice table)` — Lookup that translates the numeric state/priority/impact/urgency codes stored on every synced task table into labels; without it incidents.state is an unreadable integer (high)
-- [ ] `service_offering (Service Offering table)` — Lookup resolving the service offering referenced by incidents and change requests, and where resolution-time commitments live (medium)
+- [x] `task_sla (Task SLA table)` — SLA attachment, stage, breach time and elapsed percentage for every incident, change and requested item already synced — SLA attainment is the headline ITSM metric and is entirely absent (high)
+- [x] `metric_instance (Metric instance table)` — Per-field duration records (time in each state, time per assignee) generated by the metric engine — the raw data behind MTTR and state-dwell analysis (high)
+- [x] `sys_choice (Choice table)` — Lookup that translates the numeric state/priority/impact/urgency codes stored on every synced task table into labels; without it incidents.state is an unreadable integer (high)
+- [x] `service_offering (Service Offering table)` — Lookup resolving the service offering referenced by incidents and change requests, and where resolution-time commitments live (medium)
- [ ] `cmdb_ci_service_business and cmdb_ci_service_technical (Business Service / Technology Management Service)` — Service dimension referenced by incidents and changes; configuration_items (cmdb_ci) does not cover the service classes used for business-impact reporting (medium)
- [ ] `Group Members (user-to-group membership related list on sys_user_group)` — users and user_groups are both synced but the many-to-many join between them is not, so assignment-group headcount and workload-per-member cannot be computed (medium)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/canonical_descriptions.py
index 9a8536753fae..e4f4b79f8283 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/canonical_descriptions.py
@@ -209,4 +209,50 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
location="Location of the asset.",
),
},
+ "task_slas": {
+ "description": "An SLA attached to a task, with its stage and timings (ServiceNow `task_sla` table).",
+ "docs_url": "https://www.servicenow.com/docs/r/zurich/it-service-management/service-level-management/r_TaskSLATable.html",
+ "columns": _columns(
+ task="Task the SLA is attached to.",
+ sla="SLA definition that this record measures.",
+ stage="Stage of the SLA (In progress, Cancelled, Paused or Completed).",
+ start_time="Date and time the SLA started.",
+ end_time="Date and time the SLA stopped.",
+ planned_end_time="Breach time of the SLA, adjusted for the pause duration.",
+ original_breach_time="Breach time calculated when the SLA was first attached.",
+ percentage="Actual elapsed percentage of the SLA, less the pause duration.",
+ business_percentage="Elapsed percentage of the SLA within the schedule, less the pause duration.",
+ time_left="Actual time left before the SLA breaches.",
+ business_time_left="Time left within the schedule before the SLA breaches.",
+ has_breached="Whether the SLA has breached.",
+ ),
+ },
+ "metric_instances": {
+ "description": "One recorded instance of a metric for a record, such as the time an incident spent in a state (ServiceNow `metric_instance` table).",
+ "docs_url": "https://www.servicenow.com/docs/r/platform-administration/c_MetricInstance.html",
+ "columns": _columns(
+ definition="Metric definition that this instance was gathered for.",
+ id="Record that the metric was gathered for, such as an incident.",
+ duration="Time duration of a field value duration metric.",
+ ),
+ },
+ "choices": {
+ "description": "Labels and translations for the options of choice fields, such as incident state or priority (ServiceNow `sys_choice` table).",
+ "docs_url": "https://www.servicenow.com/docs/r/7LhbZn3yz3Q58qhjZoU9iQ/sMi0DDDxrZWOPH4WDRIIww",
+ "columns": _columns(
+ name="Table that the choice applies to.",
+ element="Field that the choice applies to.",
+ language="BCP 47 code of the language of the choice.",
+ value="Stored value of the choice, the same in every language.",
+ label="Label of the choice in this language.",
+ sequence="Number that sets the display order of the choice.",
+ ),
+ },
+ "service_offerings": {
+ "description": "An offering of a service from the service portfolio, referenced by incidents and change requests (ServiceNow `service_offering` table).",
+ "docs_url": "https://www.servicenow.com/docs/r/MlbQAgTiiiMOLOw9T36wJg/c2lHegE0bXtcpy2WSy_nog",
+ "columns": _columns(
+ name="Name of the service offering.",
+ ),
+ },
}
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/settings.py
index d1f39aa20a8a..4997b4590898 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/servicenow/settings.py
@@ -52,6 +52,10 @@ SERVICENOW_ENDPOINTS: dict[str, ServiceNowEndpointConfig] = {
"configuration_items": ServiceNowEndpointConfig(name="configuration_items", table="cmdb_ci"),
"knowledge_articles": ServiceNowEndpointConfig(name="knowledge_articles", table="kb_knowledge"),
"assets": ServiceNowEndpointConfig(name="assets", table="alm_asset"),
+ "task_slas": ServiceNowEndpointConfig(name="task_slas", table="task_sla"),
+ "metric_instances": ServiceNowEndpointConfig(name="metric_instances", table="metric_instance"),
+ "choices": ServiceNowEndpointConfig(name="choices", table="sys_choice"),
+ "service_offerings": ServiceNowEndpointConfig(name="service_offerings", table="service_offering"),
}
ENDPOINTS = tuple(SERVICENOW_ENDPOINTS.keys())