How to change the name of the "subject" field in the ticket forms?

Con risposta


Data ultimo post: 14 nov 2019

We have an interesting situation that is causing us some grief. We support students and educators. When they fill out our support ticket forms, they see a field that says "subject". To most users, this would seem to be the subject of their issue report. But for our users, a huge number of them think it's the subject they are studying or teaching in school. 

This means that we receive an inordinate number of tickets with the subject "math" or "english" and nothing useful that we can work with in our various reporting and tracking needs.

I realize that the "subject" field is a system field that cannot be altered via the Zendesk admin interface. However, I know that in the past I have seen creative solutions posted here that take advantage of code to make alterations to many parts of the interface. 

However, all my searches are coming up empty on this one.

Bottom line: I am looking for a way to change the field title "subject" to something else, such as "topic of your request".

Any help would be appreciated!


0

28

28 commenti

Hello,
 
Templates have access to various properties of your help center. For example, the New Request Page template has access to an object named new_request_form that has properties as per the form requested by the User. You can use dot notation to pluck information from the object. 
 
Example:
{{new_request_form.ticket_fields}}
 
Now, as the new_request_form object outlines > https://developer.zendesk.com/api-reference/help_center/help-center-templates/objects/#new-request-form-object
 
You can access its property > ticket_fields
ticket_fields array An array of ticket field objects containing all the standard and custom fields of the selected ticket form
 
You can see the array of Fields for this Form :
console.log(props.requestForm.ticket_fields)

 
Which will render the array of ticket fields for this Form selected :

 
And then if you want to know the level of subkeys/subprops for this Ticket Field Object, here it is > https://developer.zendesk.com/api-reference/help_center/help-center-templates/objects/#ticket-field-object
 
Then you can set the Field value as the property/attribute is accessible.
 
And thus something like :
props.requestForm.ticket_fields[0].value = "Description from Props"
As the index [0] from this Array is indeed my description field.
 
Would set the value, example (basic example use case) : 
 

 
Result:

 
You can tailor this process for CC field accordingly

0


Hello,

 

 Anyone figured out for the CC Field? 

 

0


Hey Matt - 

Code like this usually goes at the end of your script.js file.  You will need to install jQuery in your document_head.hbs file first.  I've personally had more success with Option #2.  Let me know!

0


Thanks a bunch 1263213537349!
Whereabouts should I put that code? I've tried the usual places but nothing is changing for me :hmm

0


Hey 6459866716570,

Two options here - make sure you have jQuery installed:

Option 1: 

var ticketFormName = $('#request_issue_type_select').find(':selected').text();
var $ticketTicketTitleEl = $('.new-request-title').first();
if (ticketFormName) {
    $ticketTicketTitleEl.text(ticketFormName);
}

Option 2:

  $('section.main-column h1').html('Your Custom Title Here');

Hope this helps!

Brandon

1


Hi 1263213537349

On a related note... how do I edit/remove the Ticket Form Title?

When inspecting the page I can achieve this by altering the code, but can't work out where to put this in my CSS etc. Thanks for any pointers!

0


Glad to see you figured it out 1265187840289 - and thanks for sharing it back here!

1


ah ha! I was able to figure it out, I needed to filter it by the specific text for it to know what text to change. Code below: 

if (ticketForm == 26011737489683) {
         
          //Change the description for the subject field
          $("#request_subject_hint").filter(":contains('former text here')").text("new text here");

  }

1


Hi Brandon, thank you for letting me know! I'm needing the description to just be different for this one form, but otherwise want it the same across the board and am not sure how to do this. I really appreciate your help! 

0


Hey Lydia,

You should be able to edit this in the Admin Center > Ticket Fields > Subject, no code necessary!

Hope this helps!

Brandon

0


Accedi per aggiungere un commento.

Non hai trovato quello che cerchi?

Nuovo post