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

66 Comments

  • Harrison Dimon
    Comment actions Permalink

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

    5
  • Gonzalo
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    @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
    Comment actions Permalink

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

    4
  • Tim Herby
    Comment actions Permalink

    @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
    Comment actions Permalink

    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
  • Vinay Gupta
    Comment actions Permalink

    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
    Comment actions Permalink

    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
    Comment actions Permalink

    Hello

    +1

    3
  • Sander Nelen
    Comment actions Permalink

    +1 ASAP please

    3
  • Simon N
    Comment actions Permalink

    +1, we really would benefit from this!

    3
  • Bram Gooris
    Comment actions Permalink

    +1 We need this aswell! 

    3
  • Matt McLean
    Comment actions Permalink

    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
    Comment actions Permalink

    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
  • Chad Hensley
    Comment actions Permalink

    Another vote to have Zendesk natively support this feature.

    3
  • Mantas K
    Comment actions Permalink

    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
    Comment actions Permalink

    This is a great idea and definitely needed ASAP.

    2
  • Stijn
    Comment actions Permalink

    +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
    Comment actions Permalink

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

    Can we get an official word on it?

    Matt

    2
  • Jose Cerna
    Comment actions Permalink

    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
    Comment actions Permalink

    Any update on this request?

    2
  • Dominik Kuhn
    Comment actions Permalink

    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
  • Blakelee Mills
    Comment actions Permalink

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

    2
  • Alexis Fabre Ringborg
    Comment actions Permalink

    +1

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

    1
  • Tom H.
    Comment actions Permalink

    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
  • Greg Sohl
    Comment actions Permalink

    I tried what &y wrote for signed-in agents. It did not work for me.

    https://xxx.zendesk.com/hc/en-us/requests/new?request[subject]=Check+This+Out

    Did I get that right??

    1
  • Tim Herby
    Comment actions Permalink

    Doesn't work for me.  Is this still not possible after 4 years?

    Can someone from Zendesk reply tot his?

    1
  • Nicole - Community Manager
    Comment actions Permalink

    Hey all - 

    I've added this to my list of questions for Product. In the meantime, Jose, see if this JS works for you:  

    (Copied and pasted from a comment made by Community member PaulAlexander on 4/4/10 that lives in a now-archived thread) 

    location.href.replace(

    new RegExp("([^?=&]+)(=([^&]*))?", "g"),

    function($0, $1, $2, $3) {

    var f = $($1);

    if( f ) f.value = unescape($3);

    }

    );

    location.href.replace( new RegExp("([^?=&]+)(=([^&]*))?", "g"), function($0, $1, $2, $3) { var f = $($1); if( f ) f.value = unescape($3); });

    It can be placed in any custom widget or even a global script.

    1
  • Justin
    Comment actions Permalink

    +1 We used to have this functionality and now that we think about it, it's no longer working.

    1

Please sign in to leave a comment.

Powered by Zendesk