-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add var to persist former-agents' roles for SLA metrics #43
Changes from 6 commits
9e9000e
7279234
56a68df
ba778b9
b5db00f
0ddf561
b6d3096
c245c12
7ea2f4c
bafb884
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,15 +66,26 @@ vars: | |
``` | ||
|
||
## (Optional) Step 5: Additional configurations | ||
<details><summary>Expand to view configurations</summary> | ||
|
||
|
||
### Add passthrough columns | ||
This package includes all source columns defined in the staging models. However, the `stg_zendesk__ticket` model allows for additional columns to be added using a pass-through column variable. This is extremely useful if you'd like to include custom fields to the package. | ||
```yml | ||
vars: | ||
zendesk__ticket_passthrough_columns: [account_custom_field_1, account_custom_field_2] | ||
``` | ||
|
||
### Mark Former Internal Users as Agents | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reminder to myself to add this to the transform README (no release needed there tho) after approval |
||
If a team member leaves your organization and their internal account is deactivated, their `USER.role` will switch from `agent` or `admin` to `end-user`. This will skew historical ticket SLA metrics, as we calculate reply times and other metrics based on `agent` or `admin` activity only. | ||
|
||
To persist the integrity of historical ticket SLAs and mark these former team members as agents, provide the `internal_user_criteria` variable with a SQL clause to identify them, based on fields in the `USER` table: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we include a similar update to one I suggested in the CHANGELOG here as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added a little something |
||
|
||
```yml | ||
# dbt_project.yml | ||
vars: | ||
zendesk_source: | ||
internal_user_criteria: "lower(email) like '%@fivetran.com' or external_id = 12345 or name in ('Garrett', 'Alfredo')" # can reference any non-custom field in USER | ||
fivetran-jamie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
### Change the build schema | ||
By default, this package builds the zendesk staging models within a schema titled (`<target_schema>` + `_zendesk_source`) in your target database. If this is not where you would like your Zendesk staging data to be written to, add the following configuration to your root `dbt_project.yml` file: | ||
|
||
|
@@ -102,8 +113,7 @@ In this package, this would apply to the `GROUP` source. If you are receiving er | |
vars: | ||
zendesk_group_identifier: "Group" # as an example, must include the double-quotes and correct case! | ||
``` | ||
|
||
</details> | ||
|
||
|
||
## (Optional) Step 6: Orchestrate your models with Fivetran Transformations for dbt Core™ | ||
<details><summary>Expand to view details</summary> | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,11 +39,18 @@ final as ( | |
last_login_at, | ||
created_at, | ||
updated_at, | ||
{% endif %} | ||
{% endif -%} | ||
email, | ||
name, | ||
organization_id, | ||
{% if var('internal_user_criteria', false) -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just ran it on dbt-bigquery==1.3.0 with and without providing yeah i think it works similarly to how we provide |
||
case | ||
when role in ('admin', 'agent') then role | ||
when {{ var('internal_user_criteria', false) }} then 'agent' | ||
else role end as role, | ||
{% else -%} | ||
role, | ||
{% endif -%} | ||
ticket_restriction, | ||
time_zone, | ||
locale, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be relevant to include here that this is used as a
case when
clause in the staging model. Just so users know the context of the variable. The example shows this well, but I feel a bit of an explanation to this would be helpful to someone new to the concept.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a brief note!