Question

display ticket field to certain companies

  • 17 April 2024
  • 2 replies
  • 19 views

Badge +1

with the help of this thread

 

I figured out how to hide an entire ticket field from all customer companies except customer 1. How do I go about only showing the ticket field for a few customers? like company 1 and company 6

 

Also this hides the drop down but does not hide the field label. Does anyone know how to remove the label as well?

 

<script type="text/javascript">
{% if portal.user.company_name <> "company 1")) %}
document.addEventListener("DOMContentLoaded", function() {
jQuery('#helpdesk_ticket_custom_field_cf_affected_geo_3014498').remove();
});
{% endif %}
</script>

2 replies

Userlevel 6
Badge +11

Hi.

Your best option would be to use Dynamic fields.

https://support.freshdesk.com/en/support/solutions/articles/212889-creating-dynamic-sections

 

Regards,

Badge +1

updated the submit ticket portal and I was able to do this with a javascript case scripting. if company is c1,c2,c3 do nothing Else remove the custom drop down . I have not figured out how to hide the field label yet.

 

https://support.freshdesk.com/en/support/solutions/articles/65037-conditional-statements

 

<script type="text/javascript">
{% case portal.user.company_name %}
{% when 'C1' %}
{% when 'C2' %}
{% when 'C3' %}
{% else %}
    document.addEventListener("DOMContentLoaded", function() {
          jQuery('#helpdesk_ticket_custom_field_cf_affected_geo_3014498').remove();
    })
{% endcase %}
</script>

 

Reply