Show ticket form only for certain customer

8 Comments

  • Jacob Christensen
    Community Moderator

    Hi Maarten,

    I believe this is a common use case, I haven't done it myself, but this article should take you through the required steps:
    https://support.zendesk.com/hc/en-us/articles/204579603-How-can-I-hide-ticket-forms-based-on-a-user-s-organization-

    Hope this helps!

    0
  • Maarten Wildeman

    Hi Jacob,

    Thanks a lot!

     I found this myself also but i think this is the other way around, isn't it?

    With this code

    • all forms are visible for all users, also unauthorized (which are using our support page too)
    • forms are hidden for a specific organization mentioned in the inserted code

    I cant find any solution to make a specific form only available to a specific organization.

    I am not into coding but a solution that could be coded is:

    - Hide all forms for everyone

    - Show specific form for specific tags

    - Give specific organizations specific tags

    Reading the support articles this is a feature wished for by many users.

    Thanks again for your help Jacob!

    1
  • Rona Yang

    Jacob Christensen - was this ever resolved, is there a code that does the opposite and shows forms only to certain organizations or tags? 

    1
  • Jacob Christensen
    Community Moderator

    Hi Rona and Maarten.

    Sorry, I never came back to this follow-up! Guide customizations are a little outside my wheelhouse, but I'm thinking that this should be possible. 

    Is it correct that you would want to hide all forms for anonymous users (and logged-in users who are not part of your specific org), and only display a single form for the specific org? 

    0
  • Rona Yang

    I am looking to have a specific form (Form A) that only certain organizations based on their tags can see. It would be a form hidden from all other organizations that don't have that tag and only shown to those who do. It isn't that the specific org can only see a single form, they may be able to see Form A, B,C. But other Orgs would not be able to see Form A. 

    It is similar to how tags work for knowledge base articles - uses to create groups that are allowed to see specific articles. 

     

    Thanks

    1
  • Dan Cooper
    Community Moderator

    Rona, 

    You may be able to expand upon Jacob's initial suggestion by replacing the logic that checks for the org name with code that looks at organization tags.  The below snippet should go through all of the users's organizations and if it doesn't see the tag that you want to filter from, it will hide the form from the users that lack the tag.

        for (var c in HelpCenter.user.organizations) {
    if (!HelpCenter.user.organizations[c].tags.includes("YOUR_ORG_TAG")){
    $("#TICKET_FORM_ID").hide();
    }

    I haven't verified this one, but I would suggest checking the comments on the linked page as there are some other related solutions that might help land on the right solution for you as well. 

    1
  • Anthony Wong

    Just wanted to bump the request from Maarten. I tested your suggestion above and was not able to get it to work. For the Support Admins who are not code saavy, it would be greatly beneficial if the verified code solution was provided in full, that only shows a specific form for a specific organization. 

    1
  • Amie

    Hi Anthony Wong

    Have you looked at this article here yet? It basically has all the steps you're after here. 

    https://support.zendesk.com/hc/en-us/articles/4408886229146

    Best,

    Amie

    0

Please sign in to leave a comment.

Powered by Zendesk