Restricting Satisfaction Surveys by Date

31 Comments

  • Jessie Schutz
    Comment actions Permalink

    Thanks for posting this, Graeme! I know that lots of folks will find this helpful!

    0
  • Heather R
    Comment actions Permalink

    This is incredible! Thank you!

    0
  • James Rago
    Comment actions Permalink

    This is good. My troubles is that I do not want to offer satisfaction at all if they already rated a ticket within lets say 5 days. In order to do this I think I would scrap the 1st automation and only do the normal one, but add the http target in the perform. My issue is that the condition on the Last Satisfaction Date need to be "NOT within the previous x days". Effectively it would mean if more than 5 days has passed since you were offered, then I want this automation to fire.

     

    Any thoughts on how to accomplish this?

    0
  • Thomas D'Hoe
    Comment actions Permalink

    James, Thanks!

    I need also the same thing as you!

     

    0
  • Joel Hellman
    Comment actions Permalink

    Hi James and Thomas. Ah that missing condition *tears hair out*. It's certainly a very frustrating oversight by Zendesk when working with automations. 

    Regardless of the outcome, you might want to add your voice to this product feature request to fix that: 

    Anyway, I have the same approach you request, in that I don't offer CSAT at all if the last CSAT on the customer was too recent. But it's awkward to set up. The solution we presented here is much more straight forward and easier to adopt.

    I won't go into the details but - if you want to go the prevent-CSAT-being-offered route - what I do is a bit different:

    • I have triggers which marks tickets as being candidates for a CSAT survey while ticket is still active (e.g. contains at least one public reply, etc)
    • I let my automation that fires on solved tickets of a certain age add a try_fire_csat tag on those tickets when its time to try to send a CSAT 
    • I then have a series of triggers which fires when a trigger is updated and has that try_fire_csat tag.
    • These triggers then checks and stops CSAT from being sent out under a number of circumstances, and also logs the skip reason to a custom field, for reporting
    • One of these skip reasons includes the condition Last Satisfaction Date is Within X days
    • If none of the the triggers that skip CSAT fires, the last trigger sends a CSAT

    Maybe an illustration from my triggers adds some context.

    The last trigger will trigger the CSAT firing, but if any of the skip check triggers matches before that, it will not get fired. (Again, the automation only adds a tag on Solved tickets in the time span for a CSAT, to start this trigger loop)

    Some reasons we don't present this alternative approach is that much harder to explain and more prone to mistakes if not set up correctly. 

    The version we present here also has the benefit it lets customers rate the tickets on the Help Center if they want, which is pretty neat. (One downside: the satisfaction response rate will be a bit off. )

    1
  • James Rago
    Comment actions Permalink

    Joel,

     

    What you have done is amazing. I was wondering if you might have some time to have a 1 on 1 discussion about the specifics? I too have a very convoluted trigger set up similar to yours since we use a 3rd party satisfaction software called Customer Thermometer. I would like to share with you what I current do as well in GoodData base don reporting and get your thoughts on how to get a working solution as you have built.

     

    Any thoughts on how we can connect?

    0
  • Nadia De Vriendt
    Comment actions Permalink

    We have a similar process in place, but it requires a lot less triggers. We do leave tickets on 'solved' longer than the default in zendesk though. But it'll depend on your cooldown period, I guess. 

    (https://www.checkmarket.com/kb/how-to-add-a-cool-down-period-to-the-survey-sent-via-zendesk/)

    Add a custom user field in Zendesk

    First add a custom user field to your Zendesk:

    • Question type Drop-down list.
    • Field title = “Send survey?”
    • Add two drop-down options: “Yes” and “No“.
    • The corresponding tags are also “yes” and “no“. If you are already using these tags, you can of course change these to anything you like. Remember that some conditions or actions are based on these tags so make sure to use the correct tags.

    Add a new automation

    This automation will make sure that the Send survey? field is set back to “Yes” after the cool-down period. That way a new survey invitation can be sent when the requester contacts your support team again. And the ticket can finally be closed as this will be the final action to take on it.

    1. Go to the Admin section in Zendesk and click on Automations.
    2. Click on Add automation.
    3. Give it a meaningful title, e.g. “Change “send survey?” to “yes” after 28 days and close ticket”.
    4. Add the following Conditions.
      • Ticket: Tags contains at least one of the following: csr: this tag was added by the “Send survey 24 hrs after ticket is solved” automation. You want to be sure that only those tickets are affected.
      • Ticket: Hours since solved (calender) greater than 672: this adds a cool-down period of 4 weeks (672 hours equal 28 days). If you want to send a new survey after 2 weeks (14 days) instead of 4 you put 336 hours (14 days x 24hrs).
      • Ticket: Status is Solved: one of the actions in this automation will be to add a tag ‘csr’ (see below). This is to make sure you only send the survey invitation once.
      • Requester: Send survey? is No: only when this value is “No” should it change back to “Yes”.
    5. Add the following Actions.
      • Requester: Send survey? is Yes: you need to set it back to “Yes” so that a new survey invitation can be sent next time this person contacts your support team.
      • Ticket: Status is Closed: as the status was still “Solved” you can now change it to “Closed”.
    6. Click on Create automation.

     

    Add a new trigger

    This trigger will recognize when a survey is NOT sent. That way you can recognize these tickets and close them faster.

    1. Go to the Admin section in Zendesk and click on Triggers.
    2. Click on Add trigger.
    3. Give it a meaningful title, e.g. “Add tag “no_csr” when no survey sent”.
    4. Meet all of the following conditions:
      • Ticket: Status changed to solved: this trigger should fire as soon as a ticket is set to “Solved”.
      • Requester:send survey? is No: the tag ‘no_csr’ should only be added if no survey is sent to the requester this time.
      • Ticket: Tags contains none of the following: no_csr, csr: “no_csr” is the tag this trigger will add, you only want to add this tag if it’s not already there. The tag “csr” is added when a survey is sent. You don’t want to add a “no_csr” tag if a survey was actually sent!
    5. Perform these actions:
      • Ticket: Add tags: no_csr: you’ll be able to recognize these tickets and create separate rules for them (as we’ll be doing in this article as well).
    6. Click on Create trigger.

     

    Edit 2 existing automations

     

    1.”Send survey 24 hrs after ticket is solved”

    You need to add a few additional conditions and actions so that the survey is no longer sent for each ticket that is set to “Solved”.

    1. Go to the Admin section in Zendesk and click on Automations.
    2. Click on Edit next to the “Send survey 24 hrs after ticket is solved” automation.
    3. Add no_csr to the condition “Ticket: Tags contains none of the following:”
    4. Add a new conditionRequester: Send survey? is not No.: the survey will only be sent if that field is either empty or “yes”. (it will be empty if a user contacts you for the very first time)
    5. Add another ActionRequester: Send survey? equals No. This way the customer requester field will be set to “No” as soon as the survey invitation is sent.

     

    2. Close ticket 24 hours after it’s set to “Solved”

    Automations will only fire for tickets that are less than “Closed”. That’s why you’ll need to tweak this automation a bit.

    1. Go to the Admin section in Zendesk and click on Automations.
    2. Click on Edit next to the automation that closes your tickets.
    3. Meet all of the following conditions:
      • Ticket: Status is Solved: the tickets should be solved before closing them.
      • Ticket: Hours since solved (calender) greater than xx: replace the ‘xx’ by he number of hours you wish to wait before closing tickets for which no survey invitaton was sent. You can keep the same time as the original “close tickets” automation, use the same time-frame as in the cool-down automation or use an even different period of time.
      • Ticket: tags contains at least one of the following: no_csr, no: as these tags indicate that no survey was sent you can simply close the ticket.
    4. Perform these actions
      • Ticket: Status is Closed: all you want to do is close the ticket so this will be the only action.
    5. Click on Submit.

    This one is specific for people who send their satisfaction survey with CheckMarket, but I'm guessing it would work for other external software as well. 

     

    0
  • Jessie Schutz
    Comment actions Permalink

    Hi Nadia! Thanks for sharing your set up with us!

    If you're willing, it would be awesome if you added this as a new post here in Tips & Tricks. This will help your fellow members find it, plus you'll be featured in our Community Roundup and get swag. :)

    0
  • Nadia De Vriendt
    Comment actions Permalink

    hi Jessie, just did, thanks for reminding me :-)

    0
  • Sheldon Dickinson
    Comment actions Permalink

    Hi Graeme,

    I was about to disable CSAT until I saw this. 

    I've just tried testing, but seem to be getting the below error. Would you have any insight on this?

    {"error":"RecordInvalid","description":"Record validation errors","details":{"custom_field_values.base":[{"description":"Base Last Satisfaction Date is invalid (expected a date; try YYYY-MM-DD)"}]}}
    0
  • Graeme Carmichael
    Comment actions Permalink

    Sheldon

    Glad you have not given up on CSAT. Can you paste a screenshot of the JSON part of your trigger? It may just take some fresh eyes to spot the problem.

    0
  • Thomas D'Hoe
    Comment actions Permalink

    Hi everyone,

    Could it be that the automatisation "notification recently sent" doesn't works when you have 3 surveys for the same customer on the same day?

    I have an example where the survey question was sent for 3 ticket to the same customer on the same day.

    As you can see in the screenshots, the "last satisfaction date" was on 26 March 2018.

    I have 3 ticket examples where the automatisation for survey was fired on that date (26/03/2018)

    One.

    Two.

    Three.

    Normally my automatisations are correct:

    => ask for survey

     

    Notifaction recently sent:

     

    Overview:

    Can someone help me? Thanks!

    Thomas

    0
  • Graeme Carmichael
    Comment actions Permalink

    Thomas

    Can you please check if there has been any API failures on the earlier tickets. If the API failed, then for earlier tickets, the user custom field may not have held the expected date.

    Go to Admin>Channels>API and check the Target Failures tab.

    0
  • Thomas D'Hoe
    Comment actions Permalink

    Indeed, there where some problems.

    0
  • James
    Comment actions Permalink

    Hi - I am wondering if anyone can help with JSON for a future date.  Specifically, I am less concerned about when the last satisfaction was sent and more interested in when the next satisfaction might be sent. I was hoping that the JSON referenced above could be  'now' + 30 days but I am unsure how to alter the JSON body correctly.  Any ideas?  Thanks!

    0
  • Graeme Carmichael
    Comment actions Permalink

    James

    You need to use a bit of crazy maths to add days to the date. So, as everyone knows, there are 86,400 seconds in a day. So to add one day, you will use:

    "last_satisfaction_date" : "{{ 'now' | date: '%s' | plus:86400 | date: '%Y-%m-%d' }}"

    And to add 30 days you need 30 x 86400 =2,592,000

    "last_satisfaction_date" : "{{ 'now' | date: '%s' | plus:2592000| date: '%Y-%m-%d' }}"

    If you are testing this, you may need to refresh your browser (CTR F5) to see the updated value in the custom field.

    0
  • James
    Comment actions Permalink

    Graeme - Thank you!!!  Worked like a charm.  I really appreciate the help.

    0
  • Emilie Duveau
    Comment actions Permalink

    Hello Graeme,

    Thanks for the example, it really fits our need.

    However, I have the same error Sheldon got (but I can't find an answer on how to fix it).

    I send this JSON:

    {
    "user":{
    "user_fields": {
    "last_satisfaction_date" : "{{ 'now' | date: '%Y-%m-%d' }}",
    "test_trigger" : "ok"
    }
    }
    }

    and I have this result:

    {
    "error": "RecordInvalid",
    "description": "Record validation errors",
    "details": {
    "custom_field_values.base": [
    {
    "description": "Base Last Satisfaction Date is invalid (expected a date; try YYYY-MM-DD)"
    }
    ]
    }
    }

    The update is correctly done for the field "test_trigger" which is a text field.

    If I hard-code the date, the "last_modification_date" field is correctly updated.

    Any idea about what I miss here?

    Thanks a lot!

    0
  • Graeme Carmichael
    Comment actions Permalink

    Emilie

    I am not sure how you custom fields are updating without the specifying the user in your JSON.

    I would expect to still see the line with:

    "id":{{ticket.requester.id}},

    0
  • Emilie Duveau
    Comment actions Permalink

    Graeme,

    I call the URL https://myzendesk.zendesk.com/api/v2/users/userID.json.

    It updates the given end-user. It perfectly works like this for the update of the field "test_trigger".

    Thanks.

    0
  • Graeme Carmichael
    Comment actions Permalink

    Emilie

    That makes sense  Try a copy and paste of the liquid date code to a macro or use in a test ticket. It could be a bad space or the wrong quote character.

    This works for me....

    {{ 'now' | date: '%Y-%m-%d' }} 

    0
  • Emilie Duveau
    Comment actions Permalink

    Graeme,

    It worked when I didn't copy/pasted it directly from this page - good to know!

    Thanks a lot!

    0
  • Stacy Win
    Comment actions Permalink

    Graeme,

    I'm hoping you can help me. I believe your HTTP target solution could help me with a similar use case.  I cannot seem to get the JSON to work.

    Use Case: the support supervisor would like the date the survey was responded to added to a ticket field. So they don't have to search for it. Out of the box to find the survey response date, one has to change the conversation to events and then scroll through the events and find the specific survey event. Instead, they would like a field added to the ticket that houses this information. 

    I created two custom fields for this information. One field with the type Date, and the other field with the type Text. 

    I wrote the JSON code two ways. One way was trying to get the Satisfaction Rating Date stored in Zendesk. The other way was using the timestamp method you provided for when the automation ran. This wouldn't be the exact time but it would pit would be a close estimate, as the time stamp would be within the hour of the survey submission.

    The JSON sets the ticket status to open and should populate the custom field. What happens is the ticket status is updated but I cannot get either of the custom fields to populate. Can you please shed any light on changes I need to make to get the date populated?



    0
  • Graeme Carmichael
    Comment actions Permalink

    Stacy

    Rather than using the custom field ID number, can you try the field key?

    0
  • Stacy Win
    Comment actions Permalink

    Graeme

    So we want the field placed on the ticket, not the user. So it is a custom ticket field. I don't see a field key on custom ticket fields. So I don't believe this is a change I can make.

    Stacy

    0
  • Graeme Carmichael
    Comment actions Permalink

    Stacy

    Ah, I don’t have access at the moment. Let’s see if someone is available to help.  ;)

    0
  • Graeme Carmichael
    Comment actions Permalink

    Stacy

    I was able to set the ticket date field.

    First create your HTTP target with:

    URL: https://YOURDOMAIN.zendesk.com/api/v2/tickets/{{ticket.id}}.json

    Method: PUT

    Content Type: JSON

    In your trigger, the JSON will be:

    ...which just mirrors your code with the closing bracket on line 11.

    If this fails, you can go to API>Target Failures and check if a recent HTTP client call failed. This will give a clue as to the problem.

    When testing, after you update the ticket and the target fires, you may need to refresh your browser to see the updated custom field value. Alternatively, close the ticket tab and re-open it again.

    Please note that updating ticket fields in this way is not recommended or supported by Zendesk as it can cause technical problems.

    Hope that helps.

     

    0
  • Stacy Win
    Comment actions Permalink

    Thanks. I still cannot get the field(s) to populate. I refreshed the browser and still nothing.

    There are no API error messages as the code runs, the status is switched back to open, the satisfaction score date field just isn't getting populated.

    As this solution is not recommended by Zendesk, I'll call it quits on this. I'll let the business know there is no solution for their ask.

     

    0
  • Tim McMacken
    Comment actions Permalink

    Hi,

    I can not seem to get the HTTP target to work. I am getting the following error in the API Target Failure log:

    { "error": "Couldn't authenticate you" }

    I think this is related to the fact that we use Google to sign into our zendesk rather than a standard email and password. In the how-to for this article is listed that we could use an API Token to authenticate, but I can not find where to enter the token I generated. Could someone point me in the right direction for entering the API Token? 

     

    Thanks,

    Tim 

    1
  • Morvan le boulanger
    Comment actions Permalink

    Hi Tim

     

    Did you get this solved? 

     

    I have got very same issue here.

     

    Thanks!

    0

Please sign in to leave a comment.

Powered by Zendesk