Change Ticket Subject

Answered

17 Comments

  • Graeme Carmichael
    Community Moderator

    Hi Tom

    You can change the ticket subject by clicking on it. The subject will then have a green border round it to show that it is active. Make your edit, then hit return and the subject should be updated.

    Graeme 

    0
  • Diane Albert

    Maybe more than you want to know, but....

     

    You can also do this in a macro if you have something pretty repetitive.  We have several macros created for specific things that happen - like a customer asking for all their media they've submitted to be returned to them. 

    They may send us a note that says "can I have my photos" and that's all they write (and then copy that into the description as well!) - we'll run a macro that adds tags, changes the subject to "We'll be returning your media", adds a public note of about how long that will take. 

    We then have a second macro (which can probably now could be a trigger from that previous macro) that takes the customer's address (held with custom fields from the Zendesk User Data app) and creates a private note for our production staff.  We usually look for the previous ticket numbers and add those into the note too so we have a reference to what was sent.

    Via tags, that gets pushed into another View so we know what's in the queue to leave the building - because you know that customer will email us, call our generic 800 number, and then send an instant message to their rep.  It makes it easy for our reps to say "oh I see you requested that 6 hours ago...it's being processed."

    It makes for cleaner data, and it's much easier if our sales reps are looking through the list of things to see the same subject line for the same topic.

     

    Diane

     

    0
  • Kristin Woodard

    I would like to know how to do this via jquery in the helpcenter. I already have determined how to set the subject field:

    $('#request_subject').val("Some Title Here");

    However I would like to be able to set the subject field based upon other entries in the form, and have not seen any samples for zendesk jquery "on form submit"

    Use case: Equipment Request:

    Subject = "Equipment Request Received" + {{Name}} + {{Office Location}}

    Please keep in mind, I am not a web developer, but rather a tinkerer who can muddle through things as necessary.

    0
  • Jessie Schutz
    Zendesk team member

    Hey Kristin!

    Sorry for the delayed response here! I'm checking to see if there are any coding experts around who might be able to help you with this. :)

    0
  • Westley Hatch

    Did we get any updates on this request I am trying to do something similar for our Status Change Request

    Subject: (Status Change: New Hire + Employee Name)

    0
  • Nicole S.
    Zendesk Community Team

    Hi Westley - 

    Are you referring specifically to the jquery bit? 

    0
  • Westley Hatch

    Yes I have a single ticket form that I would like to auto populate the Ticket Subject with data from other fields in the form

    for Example. The form name is Status Change.

    in this form I have a request type filed (New Hire, Transfer, or Separation)

    Then I have a text field for the Employee name.

     

    I want the subject to read Status Change: + Request Type + Employee Name

     

    I need help with the coding of this process.

    1
  • Jessie Schutz
    Zendesk team member

    Hey Westley! Sorry for the delayed response here.

    I've pinged our Community Moderators to see if one of our coding experts can help you out with this!

    0
  • Trapta
    Community Moderator

    Hi @Westley Hatch,

    Please copy the below code at the bottom of your JS -

    $(document).ready(function(){
    function updateSubject () {
    $('#request_subject').val('Status Change: ' + $('REQUEST_TYPE_FIELD_ID').val() + " " + $('EMAIL_ADDRESS_FIELD_ID').val() );
    }

    // Uncomment the below code if you want your subject field to be readonly
    //$('#request_subject').attr('readonly', 'readonly');

    updateSubject();

    $('REQUEST_TYPE_FIELD_ID').on("change", function(){
    updateSubject();
    });

    $('EMAIL_ADDRESS_FIELD_ID').on("change", function(){
    updateSubject();
    });

    });

    Replace REQUEST_TYPE_FIELD_ID with the ID of your request_type field and EMAIL_ADDRESS_FIELD_ID with the ID of your email_address field.

    If you can't find one, share your HC URL here and I'll do it for you.

    Let me know how it goes for you.

    Thanks

    0
  • Trapta
    Community Moderator

    @Kristin Woodard,

    You too can use the above code and replace the IDs with your field IDs.

    Thanks

    0
  • Vladan Jovic
    Community Moderator

    Hi Westley, here is the code. So you need to have two ticket fields, one with drop-down and another text field. When a user selects a value from a drop-down, the subject will be populated. When typing something into a text ticket field, this text will be added to the subject. You need to change all of the field IDs with your own. Hope this helps :)

    <script>

    //drop down ticket field when value selected put it into the subject
    $(".request_custom_fields_114101220391").change(function () {
    var tekst = $('.request_custom_fields_114101220391 a').text();
    $('.required.request_subject input').val(tekst);
    });

    var $text = $('input#request_subject');
    var $input = $('#request_custom_fields_114101204311');

    //text field when user type add text into the subject field
    $('#request_custom_fields_114101204311').on('focus', function () {
    var tekst = $('.request_custom_fields_114101220391 a').text();
    $input.on('keyup', function () {
    $text.val(tekst + " " + $input.val());
    });
    });

    </script>
    0
  • Sara Supply

    @Trapta  - thank you for the code. 

    I am currently using it to populate the subject with a category and customer number. The category is chosen from a drop down list and my problem is that the chosen category shows in the subject field in the tag form ('like_this') instead of the way it is shown in the list (where it reads 'Like This'). 

    Question:
    - would anyone know a way to make the query point into the label(? or visible version) of the value rather than the value itself?

    Another question:
    - Is there a way to hide the subject field from the end customer and still have the subject field populated by the values chosen/entered in the form? Right now it looks a bit silly as customers cannot edit it and it sits right at the top of the form. (I have temporarily solved this by entering a description that it will be automatically filled)

     

    1
  • Catherine Michalak
    Community Moderator

    Hello,

    Is there a possibility for the end user to make a change to their ticket subject while the ticket is still open for example?

    Thanks

    0
  • Jessie Schutz
    Zendesk team member

    Hi Catherine!

    It's not possible for an end user to change anything on a ticket after it's been submitted, other than adding additional comments. Your agents would need to make any changes to the ticket subject.

    0
  • Jamie Noell

    I have been trying to follow the code examples above, but I am getting the form name + "undefined." 

    I am trying to create the value for subject line for a ticket created in the Help Center.  The Javascript is already replacing the subject line with the name of the form.  I just want the ticket subject to be the form name appended with the value that the user entered for one of the fields.

    This code is working to reset the subject line to the ticket form name:

    $('#request_subject').val($('select#request_issue_type_select > option:selected').text());

    I am just trying to append this subject with the value of the custom field with the number for 3600xxxxxxxx.  I have tried single quotes and double quotes around the Field ID.  What am I missing?

    $('#request_subject').val($('select#request_issue_type_select > option:selected').text()+ " " + $("3600xxxxxxxx"'").val());
    0
  • Trapta
    Community Moderator

    Hi @Jamie Noell,

    Try using below code and replace ID with your custom field ID:

    $('#request_subject').val($('select#request_issue_type_select > option:selected').text() + " " + $('.request_custom_fields_ID').find('.nesty-input').text() );

    Let me know if this solves your issue.

    Team Diziana

    0
  • Anton Van der meyden

    Hello Everyone,

     

    @Trapta 

    Can you assist me with the following please. Going of the the code that Trapta provided I'm trying to hide the subject field but when the value is picked from a custom field that this will populate as the subject line in the ticket. The custom field is a drop down box.

    The code below is only returning the name of the Form in the subject line for me. I have this code under new_request_page.hbs instead of in the script.js as i would like to use multiple custom forms.

     

    <script>

    $(document).ready(function(){

    var ticketForm = location.search.split('ticket_form_id=')[1];


    if(ticketForm == 360001758153) {
    $('.form-field.request_subject').hide(); // Hide subject
    $('#request_subject').val($('select#request_issue_type_select > option:selected').text() + " " + $('.360026775373').find('.nesty-input').text() );


    }


    });

    </script>

    0

Please sign in to leave a comment.

Powered by Zendesk