Recent searches


No recent searches

How do I set or change the department of a chat?



image avatar

Elissa Tikalsky

Zendesk Digital Resources Team

Edited Nov 15, 2023


1

8

8 comments

How to set department after working hours? It's not working on the web widget!

1


image avatar

Dion

Zendesk Customer Care

Hey Martin,

You can set the operating hours of a department by going to settings > hours > operating hours and then select department schedules. You can check this article for more information: Setting up operating hours


 

0


I know how to change operating hours. The problem is after operation hours end, our tickets don't have any assigned department. 

0


image avatar

Dion

Zendesk Customer Care

I see thanks for letting me know. I would suggest that you contact our customer support team so that you can provide more details and we can provide further assistance. Please check this article to know how: Contacting Zendesk Customer Support

0


Dion

We are attempting to select the department in js based on the tags present. However doing so, our script fails and returns no selected visitor department.. Could you help us have a look at this?

//ChatPanel is third-party chatbot window which pushes a JSON-array we can grab tags from

chatPanel.addEventListener("openZendesk",function(_ref3) {

  var detail = _ref3.detail;

  if (detail && detail.tags) {

    zE("webWidget","chat:addTags", detail.tags);

   




  }

  if(detail.tags = detail.tags.anti-churn)

  {

      zE('webWidget', 'updateSettings', {

  webWidget: {

      chat: {

          departments: {

              enabled: ['group1'],

              select: ['group1'],

          }

            }

              }

  });

  }

  else

  {

    zE('webWidget', 'updateSettings', {

  webWidget: {

      chat: {

          departments: {

              enabled: ['group2'],

              select: ['group2'],

          }

      }

  }

});




  }

});

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi David! It's difficult to say exactly what the issue may be from the snippet that you shared. There is an event listener that's firing both of your `if` statements and it seems that the second one is dependent on the first one. I would recommend console.logging/debugging to see where this is stopping so that you can figure out where the breakdown is occurring. 

To test if the issue is with our API, you can simply run a script on the site where you have your widget with only the widget code to see if it updates properly.

0


Greg Katechis by debugging the console tell us our script runs as expected, going through the if statement, tho non of them selects the chat department.

When the visitors request a chat through this script, it goes to 'no department'.

We tried solving this with tags in the script for the Chat triggers to pick up on:

zE("webWidget","chat:addTags", "group 1");
Despite the tags being added, our Chat triggers are not selecting the Visitor department, as if the 'no department' cannot be overridden. Note, we are using Agent Workspace and know about the merge between groups/departments.
 
For Visitor departments in Chat triggers, should we still be able to leverage this in our situation?
Thanks!

0


Adding a question to do, should we even be able to select the Chat department with an if statement here?

0


Please sign in to leave a comment.