Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update replies metrics to fit proper Zendesk definition #102

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# dbt_zendesk v0.10.3
[PR #102](https://github.com/fivetran/dbt_zendesk/pull/102) includes the following updates:
## 🐛 Bug Fixes 🪛
- Fixed the `total_agent_replies` field in `zendesk__ticket_metrics` so the value is derived from public agent comments logic, and also ignores ticket creation comments from an agent, matching the Zendesk definition.

# dbt_zendesk v0.10.2
[PR #101](https://github.com/fivetran/dbt_zendesk/pull/101) includes the following updates:
## Fixes
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'zendesk'
version: '0.10.2'
version: '0.10.3'

config-version: 2
require-dbt-version: [">=1.3.0", "<2.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration_tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ target/
dbt_modules/
logs/
.DS_Store
dbt_packages/
dbt_packages/
env/
2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2

name: 'zendesk_integration_tests'
version: '0.10.2'
version: '0.10.3'


profile: 'integration_tests'
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dbt-snowflake>=1.3.0,<2.0.0
dbt-bigquery>=1.3.0,<2.0.0
dbt-redshift>=1.3.0,<2.0.0
dbt-redshift>=1.3.0,<1.5.0
dbt-postgres>=1.3.0,<2.0.0
dbt-spark>=1.3.0,<2.0.0
dbt-spark[PyHive]>=1.3.0,<2.0.0
Expand Down
6 changes: 5 additions & 1 deletion models/intermediate/int_zendesk__comment_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ comment_counts as (
count(*) as total_comments,
count(distinct case when commenter_role = 'internal_comment'
then user_id
end) as count_ticket_handoffs
end) as count_ticket_handoffs,
sum(case when commenter_role = 'internal_comment' and is_public = true and previous_commenter_role != 'first_comment'
then 1
else 0
end) as count_agent_replies
from ticket_comments

group by 1, 2
Expand Down
2 changes: 1 addition & 1 deletion models/zendesk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ models:
- name: open_status_duration_in_calendar_minutes
description: The duration in calendar minutes the ticket was in the "open" status
- name: total_agent_replies
description: The total number of agent replies within the ticket
description: The total number of agent replies within the ticket, excluding comments where an agent created the ticket
- name: requester_last_login_age_minutes
description: The time in minutes since the ticket requester was last logged in
- name: assignee_last_login_age_minutes
Expand Down
2 changes: 1 addition & 1 deletion models/zendesk__ticket_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ select
ticket_work_time_calendar.requester_wait_time_in_calendar_minutes,
ticket_work_time_calendar.agent_work_time_in_calendar_minutes,
ticket_work_time_calendar.on_hold_time_in_calendar_minutes,
coalesce(ticket_comments.count_agent_comments, 0) as total_agent_replies,
coalesce(ticket_comments.count_agent_replies, 0) as total_agent_replies,

case when ticket_enriched.is_requester_active = true and ticket_enriched.requester_last_login_at is not null
then ({{ dbt.datediff("ticket_enriched.requester_last_login_at", dbt.current_timestamp_backcompat(), 'second') }} /60)
Expand Down