Hotline Logo freshchat

Start a new topic

Placeholder for freshdesk instance ID fo use in Apps

It would be nice if I could use something like

var company_id = jQuery('#helpdesk_ticket_custom_field_company_id_{{freshdesk.id}}');

instead of:

var company_id = jQuery('#helpdesk_ticket_custom_field_company_id_276082');

 in apps.




1 person has this problem
1 Comment

Freshdesk calls this an Account ID and I just saw that there is a window.current_account_id variable that contains that value. You can search the HTML source code of a ticket page to find it. You can also install this custom app ( and enable it for Ticket detail page ). Then, just view a ticket and you will see the Account ID at the bottom of the right sidebar.
<div id="current_account_id">Freshdesk Account ID is xxxxxx</div>
<script type="text/javascript"> 
  function print_current_account_id() {
    console.log('window.current_account_id [' + window.current_account_id + ']');
    jQuery('#current_account_id').html('Freshdesk Account ID is <b>' + window.current_account_id + '</b>');
  }
  jQuery(document).on('ticket_view_loaded', print_current_account_id);
</script>

 

 

Login or Signup to post a comment