fivetran / dbt_zendesk

Fivetran's Zendesk Support dbt package
https://fivetran.github.io/dbt_zendesk/#!/overview
Apache License 2.0
25 stars 30 forks source link

[Feature] Update Zendesk SLA policies to look at historical agents #120

Closed jackiexsun closed 5 months ago

jackiexsun commented 8 months ago

Is there an existing feature request for this?

Describe the Feature

Currently the way the zendesk package calculates SLA policies is to check whether the user is an "agent" or "admin" role to meet the SLA. We are starting to deactivate former employees in Zendesk since they take up licenses so they won't be an "agent" or "admin" role anymore. This will retroactively impact our SLA policy calculations. Can we modify the package to use another way to determine if the user is an internal company user (like looking at the email domain) or enable the ability to use a zendesk user history table so we can see if the user was ever an "agent" or "admin"?

Describe alternatives you've considered

No response

Are you interested in contributing this feature?

Anything else?

No response

jackiexsun commented 7 months ago

Hi @fivetran-jamie @fivetran-joemarkiewicz are we able to prioritize this soon? IT has started deprovisioning Zendesk users so I expect our metrics will change because of this.

fivetran-joemarkiewicz commented 7 months ago

Hey @jackiexsun I had planned to incorporate this into the current sprint, but had to deprioritize due to a different Zendesk ticket. I am planning to fold this into the upcoming sprint. We can chat with you further once someone from my team picks this up in the next sprint!

cpmclaughlin commented 7 months ago

@fivetran-joemarkiewicz I'm also very interested in this package handling former agents as agents rather than end users. Please apply this fix to reply times and resolution times as well as to SLAs. Would love to know when you'll be working on this and when to expect it to be resolved when possible. Thanks!

fivetran-jamie commented 7 months ago

@cpmclaughlin currently working on this! for your own case, would you only look at email domains, or would you want this additional internal-user criteria to be more flexible (ie reference other USER columns)?

cpmclaughlin commented 7 months ago

@fivetran-jamie so excited to hear that!!! More flexible internal-user criteria would be most helpful. Unfortunately, in our case email domain alone would not work. What I'd been considering using before I found that you all were about to work on this was

where ((signature is not null and signature is distinct from '') or (alias is not null and alias is distinct from ''))
        and (restricted_agent = TRUE or suspended = TRUE)
        and (email ilike '%modernhealth%' or email is null)

Let me know if you have any additional questions and thank you for working on this!!! Will be incredibly helpful to us.

fivetran-jamie commented 7 months ago

thank you @cpmclaughlin this is super helpful! figured email domain would be a popular route but not cover everything for some folks

i've added a zendesk__internal_user_criteria variable that would essentially be a where clause defining other criteria for tagging former agents, so in your case you'd configure that like

# dbt_project.yml
vars:
  zendesk__internal_user_criteria: "((signature is not null and signature is distinct from '') or (alias is not null and alias is distinct from '')) and (restricted_agent = TRUE or suspended = TRUE) and (email ilike '%modernhealth%' or email is null)"

i have a working branch if you'd like to try it out! the changes should be reflected in zendesk__sla_policies, zendesk__ticket_metrics, and zendesk__ticket_summary

packages:
  - git: https://github.com/fivetran/dbt_zendesk.git
    revision: feature/tag-former-agents
    warn-unpinned: false

@jackiexsun would you have bandwidth to try this branch out on our own Zendesk data as well?

cpmclaughlin commented 7 months ago

@fivetran-jamie will I (or rather, my data eng counter part) be able to define the variable in using the fivetran quickstart data models or only if we were using the transformations for dbt core? Right now, we're only using the quickstart for this instance of zendesk because we're already using the transformations for dbt core for another instance we have. If the new variable you're working on only works with transformations for dbt core, is it possible to set that up for multiple instances now? I think I saw a ticket for that too at some point. Thanks!

jackiexsun commented 7 months ago

@fivetran-jamie yes I can test this out!

fivetran-jamie commented 6 months ago

@cpmclaughlin Darn yeah you would only be able to define the variables if using transformations with dbt core, not with Quickstart.

But if the overall goal is to run the package on multiple zendesk instances, perhaps this blog post would be of use to you.

We do have a couple of tickets open to natively run the package on multiple sources and are heavily considering adding this functionality, but no firm timeline yet

jackiexsun commented 5 months ago

Hi @cpmclaughlin is this the criteria for identifying former agents that you landed on? I'm trying to do something similar for Fivetran, and got to

where suspended and email like '%@fivetran.com'

but it's not 100% accurate. Wondering if you got to a more accurate criteria? I asked Zendesk support about this problem and they were not helpful :/

@fivetran-jamie so excited to hear that!!! More flexible internal-user criteria would be most helpful. Unfortunately, in our case email domain alone would not work. What I'd been considering using before I found that you all were about to work on this was

where ((signature is not null and signature is distinct from '') or (alias is not null and alias is distinct from ''))
        and (restricted_agent = TRUE or suspended = TRUE)
        and (email ilike '%modernhealth%' or email is null)

Let me know if you have any additional questions and thank you for working on this!!! Will be incredibly helpful to us.

fivetran-jamie commented 5 months ago

this has been rolled out in v0.10.1 of the source package! as a minor change, the transform package should automatically pick it up! cc @cpmclaughlin