Skip to main content

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>

Hi.

Your best option would be to use Dynamic fields.

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

 

Regards,


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>

 


The above code still kept the header but removed the field from the list. I’ve updated it to use the following and now it removes the entire form label from code. 

 

    document.addEventListener("DOMContentLoaded", function() {
        jQuery(document).ready(function($) {
        $('.form-labelfor="helpdesk_ticket_custom_field_cf_affected_geo_3014498"]').closest('.form-group').remove();
    }); 


Reply