Most Popular
Recently Added
Recently Updated

Automatically setting yourself as next worker

You can use Cerb's Virtual Attendants to automatically set yourself as the owner when replying to tickets. In this example, we'll show you how to do that only if there isn't already an assigned worker.

First, you'll need to know the database ID of your worker account. The easiest way to get this is for you (or an admin, if you're not one) to go to Setup -> Workers & Groups -> Workers and click on your worker account. The URL will contain the ID. For example, admin/profiles/worker/1-Super_User indicates the that databse ID of the worker is "1".

Next you'll create a new VA for yourself. Click your name (in the top right) and select "Virtual Attendants". If you already have a worker-owned VA that you want to use, click on it, or click the green (+) on the worklist to add a new VA, owned by you (call it what you like).

Click Create Behavior and import the following, changing the ID in the $select_owner.val('1'); statement to whatever your worker's database ID is:

{
  "behavior":{
    "title":"Take on Reply",
    "is_disabled":false,
    "is_private":false,
    "event":{
      "key":"event.mail.reply.pre.ui.worker",
      "label":"[UI] When starting a reply to a message"
    },
    "nodes":[
      {
        "type":"action",
        "title":"Set next worker value",
        "params":{
          "actions":[
            {
              "action":"exec_jquery",
              "jquery_script":"var $reply = $(this);\r\nvar $form = {\r\n\tfields: $reply.find('form:nth(0)'),\r\n\tactions: $reply.find('form:nth(1)')\r\n};\r\n\r\nvar $select_owner = $form.actions.find('select[name=owner_id]');\r\nif($select_owner.val() == 0)\r\n    $select_owner.val('1');"
            }
          ]
        }
      }
    ]
  }
}

That should do it - now, when replying, if the ticket is not already assigned to another worker, it will automatically be assigned to you.


Properties ID: 000108   Views: 1814   Updated: 5 months ago
Filed under:
knowledgebase comments powered by Disqus