PAID: $50 bounty for ajaxifyng the dependent dropdown field on a node form

On a Drupal 7 website I have a node creation form with several fields: `field_accounts, field_status, field_priority, field_department, field_body`. All the fields are standard ones (of `List (text)` and `Long text` types) except `field_accounts`, which is of `Entity Reference` type. On the UI it looks like this:

There are three possible values for the Department field: Sales, Support, Billing. And because users have different access levels to customer accounts’ departments, I need to limit selection values for them.

And to make everything work on the same page, we would like to use the ajax_example_dependent_dropdown function to allow the current user to select a customer account and depending on his choice to limit possible selection values for the Department field.

Ready to pay $50 bounty through PayPal who will implement this in a form_alter function. To start with:

function my_custom_module_form_alter(&$form, &$form_state, $form_id) {
  global $user;

  if ($form_id == 'ticket_node_form') {
Drupal version: