Pre-populate ticket submission form field via query string (Help Center)

Planned

80 Comments

  • Official comment
    Leah
    Zendesk Voice of Customer Team

    Hi everyone! 

    Thanks for all of your feedback on this issue. We understand it's been difficult to give your users a more seamless experience without using some extra custom coding. Our product team is planning to address this issue. 

    Again, we really appreciate you all voices your need and especially those who went into detail about what their business goals are. This helps us understand the full scope and impact to your business. 

    Stay tuned for more updates on this issue!

  • Harrison Dimon

    Can't stress enough how important this is to so many people for so many reasons. Please prioritize

    5
  • Gonzalo

    I can't believe yo can't pre-populate a form using url params in Zendesk ... 6 years old this request and not sorted yet. Just gives you an idea on how responsive is this product to business demands. Shameful.

    5
  • Greg Sohl

    Hello, Zendesk? We all understand there's only so much development time to go around, but this should be 101 stuff.

    The courtesy of a reply would be appreciated.

    Greg

    4
  • Sergio Negri

    @Nicole this solves the problem of parsing the URL, not how to properly set those data in the form. Or am I missing something?

    4
  • Gtagliabue

    Can't believe this was open in 2013. Can this please get some real attention?

    4
  • Tim Herby

    @Nicole, do you have an update from the product team?  We could critically use this to capture some simple information about our customers that we already have in-product, rather than making them type it in again in the helpdesk.  This means we have a huge loss of information when people click over to the help form.  If we could simply capture the UserID reliably, that would be huge.

    Your customers have been asking for this feature for 5 years, and it's a simple feature, just capturing values and pre-filing one form.  As the CTO of a software company, I know you have many competing priorities, but I also know this is a simple change.  I implore you to consider the small size of this feature and the obvious customer demand as evidenced in this thread.

    4
  • Tim Herby

    Jira has this feature for filing bugs and tickets. https://confluence.atlassian.com/jirakb/creating-issues-via-direct-html-links-159474.html

    It's very standard part of how the web works (link to a form and pre-fill information), and your customers have been asking for 5 years.  The lack of response to this ticket, and continued inability to take it seriously is one of the reasons we are looking to leave Zendesk.

    4
  • Chad Hensley

    Another vote to have Zendesk natively support this feature.

    4
  • Vinay Gupta

    In my opinion this is one functionality which is very critical for me because it relates to the effort which my customers need to make to report their issues. Pre-populating the fields makes it immensely effective and ensures that they find it a quick and fruitful experience.

     

    Can we expect this feature being implemented in near future?

     

    Thanks

    3
  • Aaron U'Ren

    We would also like this feature. This is a feature that was implemented for the previous interface, but now, as the thread Tom pointed out mentions, this no longer works with the new ZenDesk interface. This is really useful to our business as we have an application that already has most of the information needed for the ticket submission form available to it. Our support agents use this application as a first lookup to verify user identity and other information. However, when it comes time to making a ticket, they then have to go to ZenDesk and enter all of the same information over again. It would be very helpful to be able to craft a URL that would set the information on the ticket that our support agent has already looked up.

     

    This feature was deemed important enough to add to the last interface, I think that it deserves to be brought back in the new interface.

    3
  • Alexis Fabre Ringborg

    Hello

    +1

    3
  • Sander Nelen

    +1 ASAP please

    3
  • Simon N

    +1, we really would benefit from this!

    3
  • Bram Gooris

    +1 We need this aswell! 

    3
  • Matt McLean
    Community Moderator

    Here's the code I added to our "new_request_page.hbs" to get this functionality:

    <script>
    (function ($) {
    var aliases = {
    //this section is optional. the integers for your custom
    //fields can be found by going to the edit page for each field

    //'user_friendly_custom_field_name1': 'custom_field_id_(integer1)'
    //'user_friendly_custom_field_name2': 'custom_field_id_(integer2)'
    }
    var parsedQueryString = function () {
    var segments = window.location.search.substr(1).replace(/\+/g, ' ').split('&'),
    parsed = {};
    if (!segments) return parsed;
    for (var i = 0, count = segments.length; i < count; i++) {
    var parts = segments[i].split('='),
    key = parts.shift(),
    value = parts.length ? decodeURIComponent(parts.join('=')) : null;
    parsed[key] = value;
    }
    return parsed;
    }
    $(document).ready(function () {
    var query = parsedQueryString();
    for (var key in query) {
    if (!query.hasOwnProperty(key) || key == 'ticket_form_id') continue;
    var prefix = '#request_',
    value = query[key];
    if (typeof aliases[key] !== 'undefined') {
    key = aliases[key];
    }
    if (key == 'email') {
    prefix += 'anonymous_requester_';
    } else if (/^\d+$/.test(key)) {
    prefix += 'custom_fields_';
    }
    var field = $(prefix + key),
    data = field.attr('data-tagger');
    if (data) {
    data = JSON.parse(data);
    var label = '';
    if (!value) {
    label = data[0].label;
    } else {
    for (var i = 0, count; i < data.length; i++) {
    if (data[i].value == value) {
    label = data[i].label;
    break;
    }
    }
    }
    field.val(value).closest('.nesty-input').text(label);
    } else {
    field.val(value);
    }
    }
    })
    })(jQuery)
    </script>

    All of the above code was lifted from the old pre-populate the new ticket form ? – Zendesk Support comments page which seems to have gotten removed. A version of the above code was originally shared by Ian Beck -- see https://gist.github.com/onecrayon/a1e5d3d30b737856dde1b193205b1c95

    I added the above script to one of my help centers almost 2 years ago (Copenhagen theme) and it has continued to serve me well.
    You can pre-fill the 'description' field by simply using:

     &descripton=Your+string+goes+here 

    You can pre-fill any custom fields by either using their identifier integer in the URL, or if you use the optional "aliases" section, you can use a friendly human-readable name for each custom id.. for example, we were using it in location-based kiosks to auto-populate the "location" dropdown menu (which corresponds to a tag):

    https://subdomain.zendesk.com/hc/en-us/requests/new?ticket_form_id=1000&description=Foo+bar&location=location_usa

    (Obviously you'd have to change your subdomain, locale, and your ticket form id for it to work. If you are trying to pre-populate dropdown fields, the "tag" that you put in for your custom field needs to be valid.)

    Thanks again to Ian Beck for this code!

    3
  • Anders Vännman

    I agree totally!

    For an example

    We are in a process where we want to use a HR-managment system for onboarding, the company that develops that solution are prepared to forward some of the process to our Zendesk with a query string for completion of some IT-specific fields that arent available in the HR-system (and shouldnt be managed there).

    But it cant really be done out of the box... 

     

     

    3
  • Blakelee Mills

    Adding my vote for ZenDesk to support this feature without the use of a paid-for app. 

    3
  • Anders Vännman

    I have given up on Zendesk adding any useful new features, like this one.

     

    If it wasnt for the fact they have the (in my opinion) best gui for IT helpdesk we would have left them for good. 

    3
  • Mantas K

    Totally agree. We would like to include a Zendesk link into our CRM with default values for a ticket. Then the agent would be able to further complete the ticket. With API you cannot create a draft ticket.

    2
  • Jon Hughes

    This is a great idea and definitely needed ASAP.

    2
  • Stijn

    +1, please see ticket #1005373 that I've raised about this.

    An easy integration with this is so much more preferable then;

    • looking up of the user exists, through the API;
    • create the user if he doesn't, through the API;
    • create and pre populate the ticket through the API;
    • redirect the user to the correct place afterwards.

    Especially when you're doing a non-complex integration with Zendesk like replacing a "mailto" functionality.

    Here's how we do this with the current URL structure on the "old" forms;

    https://<domain>.zendesk.com/tickets/new?ticket[requester]=stijn@somedomain.com

    2
  • Matt Farrington Smith

    This would be welcomed - can't believe it doesn't exist already.

    Can we get an official word on it?

    Matt

    2
  • Jose Cerna

    I agree this would help my users so much, I can't see javascript example. that Joe wrote because I don't have access. Can you repost or set it to public again?

    2
  • Justin

    Any update on this request?

    2
  • Dominik Kuhn

    Indeed! It's ridiculous how less Zendesk cares about its customer request.

    Even with JS, we are highly limited in building solutions.

    They should allow end-users to access the ticket fields API. Then we could at least code proper prefill functions.

    2
  • Forrest Jacoby

    +1 here. Seven years is making Salesforce look nimble by comparison.

    2
  • Thomas Verschoren
    Community Moderator

    Hey,

     

    The code below works for every field with the bold part replaced with the ID of the dropdown and the TAG of the field option

    https://demo.premiumplus.io/hc/en-us/requests/new?ticket_form_id=360000534040&request_custom_fields_360007388180=some_text

    $(document).ready(function() {
    /* Start QR */
    var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
    sURLVariables = sPageURL.split('&'),
    sParameterName,
    i;

    for (i = 0; i < sURLVariables.length; i++) {
    sParameterName = sURLVariables[i].split('=');
    if (sParameterName[1] == "false"){$("#" + sParameterName[0]).prop("checked",false);}
    else if (sParameterName[1] == "true"){$("#" + sParameterName[0]).prop("checked",true);}
    else {$("#" + sParameterName[0]).val(decodeURIComponent(sParameterName[1]).replace(/\)\(/g, "<br/>"))};
    }
    };
    getUrlParameter("");
    /* End QR */
    });
    2
  • Alexis Fabre Ringborg

    +1

    We were also using this feature previously and it is not working anymore, so this is a loss for us

    1
  • Tom H.

    Unfortunately the Javascript code in the thread that Joe linked to doesn't seem to work anymore. Added it to my New Request form, but the parameters are ignored. Too bad, I'd also really like this feature. 

    1

Please sign in to leave a comment.

Powered by Zendesk