This is a sample list element (<li></li>) created for the 'My Test' custom ticket field:
<li class="text custom_text field">
<label for="helpdesk_ticket_custom_field_my_test_276082">Test text</label>
<input id="helpdesk_ticket_custom_field_my_test_276082" class=" text" type="text" size="30" name="helpdesk_ticket[custom_field][my_test_276082]">
</li>
This is a sample list element created for the 'My GUID' custom company field:
<li class="show-field">
<p class="field-label break-word">My GUID</p>
<p class="field-value break-word">6d2d2107-3112-4d47-a439-1b3b8ffd6e83</p>
</li>
Neither list element has identifiers unique to the specific custom field. For example:
If I have a 'My First Test' and a 'My Second Test' custom ticket fields I cannot use jQuery to hide just 'My Second Test'.
I propose that an extra argument is added to the class of the list, probably based on the ID that Freshdesk internally uses for each custom field (and definately not based on something that might change like the name of the field).
In this way, instead of 'My First Test' and 'My Second Test' both having the same list class identifiers:
<li class="text custom_text field">
each will have distinct list class identifiers, like:
<li class="text custom_text field ctfid_345678">
for 'My First Test' and:
<li class="text custom_text field ctfid_743743">
for 'My Second Test'
(ctfid = custom ticket field id)
When that is in place, I can use jQuery to its full power. I can hide/show elements, read/write option values, change css or whatever. This is really useful.
Tip: Since some DOM elements, like the list of custom ticket fields, may not be available upon loading but may take some more time to come into existence, one can use something like https://github.com/uzairfarooq/arrive to watch for element creation. I already tried that and it works fine. If anyone is interested, one only has to include 'arrive.min.js' in her FreshPlug code and then try something like this:
-----------------------------
<script type="text/javascript" >
jQuery(document).arrive(".text.custom_text.field", function() {
// 'this' refers to the newly created element
var $newElem = jQuery(this);
console.log("Element created");
// Either of the next two lines will work (to hide the element)
//jQuery(".text.custom_text.field").hide();
//$newElem.hide();
// unbind all arrive events on document element which are watching for ".text.custom_text.field" selector
jQuery(document).unbindArrive(".text.custom_text.field");
});
</script>
-----------------------------
In fact, I would also propose that arrive.js is natively supported, if individual IDs for custom fields are implemented.
Closed for Voting
Individual class identifiers for custom ticket fields and custom company fields
Join the Community
Already have an account? Login
Welcome back to Freshworks Community
No account yet? Create an account
Social Login
Login for Freshworks Employees Login with LinkedInor sign up below
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

