Created
          February 20, 2014 23:23 
        
      - 
      
- 
        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.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <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