Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created February 20, 2014 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstachl/9125456 to your computer and use it in GitHub Desktop.
Save tstachl/9125456 to your computer and use it in GitHub Desktop.
This shows how you can use javascript to fetch the assigned group from the case tab and based on the value show an additional custom field on the customer theme.
<div class="agent_customer_section" id="my_custom_field" style="display:none;">
{{custom_my_custom_field}}
</div>
<script>
$(function() {
var case_assigned_group = $('#edit_customer_{{customer.id}}')
.closest('#case_sidebar')
.find('#ticket_group_id option:selected')
.text();
if (case_assigned_group == 'Supervisor') {
$('#edit_customer_{{customer.id}}').find('#my_custom_field').show();
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment