Recent searches
No recent searches
Hide Ticket Forms based on Customer Organisation
Posted Dec 19, 2024
I'm aware there is an article on this issue but it is outdated for our theme version (Copenhagen 4.2.3). We have never changed our theme and this is the standard theme out of the box.
I was speaking to a Zendesk support agent on this issue who stated that the workflow I included in the link above will not work as our theme version requires React to hide the forms.
What I am looking to achieve is the following;
I have 3 ticket forms. Form A, Form C & Form F. Form A is the generic ticket form all our customers. Forms C & F are specific forms for 2 SLA customers we have. When customers log into their portal to raise tickets, we want the correct form to display based on that customer's organisation.
It would be great if someone could help me on achieving this but I also think this should be a standard feature provided by Zendesk and I'm very surprised a feature like this does not exist as standard.
2
5 comments
Emily Reidy
Thank you for taking the time to provide us with your feedback. This has been logged for our PM team to review. For others who may be interested in this feature request, please add your support by upvoting this post and/or adding your use case to the comments below. Thank you again!
0
James Peterson - Eastern Logic
Hi Andrew English,
I did some poking around with the new Copenhagen 4.2 theme and was able to get this working, but I did have to make some modifications to the solution provided in the article you linked here. I've written a comprehensive explanation on our Help Centre, please feel free to check out the article.
The main difference for me was that I had to use a different selector logic than what was presented in the article; specifically I had to check my page for the element ID for the specific form in the list rather than use the ticket form ID. It was a bit tricky because I had to add breakpoints using the browser console so I could lock in on the form when it appeared, but once I got that ID I was able to hide it.
The code I used is below, with the main changes being I had to append the CSS I needed to hide the form directly into the head, and use the selector
#id\\:0--option-2
, with the\\
used to escape the:
, and the2
being the index of the form (0-basde index, 3rd form in the list).const userOrgs = window.HelpCenter.user.organizations;
const userOrgNames = userOrgs.map(org => org.name);
if (!(userOrgNames.includes("ZENDESK"))) {
$('head').append('<style type="text/css">#id\\:0--option-2 {display: none;}</style>');
}
Hope this helps out!
2
Andrew English
Hi James Peterson - Eastern Logic
Thank you for taking the time to help me on this. I really appreciate it!
Emily Reidy perhaps this could be added as a new workflow for customers with theme Copenhagen 4.2?
I have tested this locally and it is working as expected for my 3 forms and their respective organisations. Now, I'm focusing on some of the aesthetics. A user has to select a dropdown despite the fact there will only ever be 1 option for their organisation. I did see a user with a similar issue in an old post somewhere, so I will try to implement that too.
Once again, thank you for your help James.
0
James Peterson - Eastern Logic
Hi Andrew English ,
Glad it worked out. You should definitely be able to set it up that the form will appear right away without clicking, but that might take a few extra steps. Please feel free to reach out if you get stuck along the way.
0
James Peterson - Eastern Logic
Andrew English - I'm curious, were you able to find a solution for the other problem you mentioned, specifically that a user must still select a form even if only one is available? This might be solvable with some custom code as well.
0