Can a Custom Ticket Field be required ONLY when a specific Category is selected?
We have Custom fields for users to select and want them to be required, but only when the specific category is chosen.
For example: HR gets a ticket for employee termination, we want the username and title required then. But if the HR ticket is for information regarding PTO policy, this is not required. Thanks for your Help!
For example: HR gets a ticket for employee termination, we want the username and title required then. But if the HR ticket is for information regarding PTO policy, this is not required. Thanks for your Help!
0 Comments
[ + ] Show comments
Answers (3)
Answer Summary:
Please log in to answer
Posted by:
chucksteel
8 years ago
One way to approach this as a work around is to create a rule that looks for tickets in Category A that don't have a value in Field B or have the default value. Normally for required fields I set the default value to something like: REQUIRED: Enter the information here. If the field still contains that string then I send the user an email periodically. You can set the rule to run every 15 minutes if you want to be very aggressive.
Posted by:
wroncallo
8 years ago
Top Answer
Why not add JavaScript to a read only custom field that checks the value of the select list and then if Employee Termination is selected you make the fields required.
if (selObj.value == 'Employee Term')
{
document.getElementById("myText").required = true;
}
else
{
document.getElementById("myText").required = false;
}
Comments:
-
You can't add Javascript to a custom field on the K1000. - chucksteel 8 years ago
-
Thanks, is there a reason why you can't add it to a read-only custom field? - wroncallo 8 years ago
-
You would have to put the Javascript code as the default value of the field and the K1000 escapes the value in that you enter so the browser doesn't render it as JavaScript. Instead it will display the code as text on the page. - chucksteel 8 years ago
-
That does not happen to me on the K1000, but perhaps my version is different? 6.4.120756 - wroncallo 8 years ago
-
I noticed that my model # says 1200, too, wonder if that is the difference too. - wroncallo 8 years ago
-
Interesting. How did you enter the JavaScript? When I did a quick test on my K1000 it showed the code. - chucksteel 8 years ago
-
Exactly as if you would enter it yourself on an HTML page: <script type="text/javascript"> code </script>
Adding HTML has no escaping as well. - wroncallo 8 years ago -
Ah, I see what I did. I made my custom field a Note and that doesn't work, but a text field does. Cool. - chucksteel 8 years ago
-
Excellent, I can definitely see why a note field would do what you said. Yes, the text field is what I use for this. - wroncallo 8 years ago
Posted by:
Hobbsy
8 years ago
There is no functionality that will allow either
Custom fields to appear on certain conditions or
Any fields, custom or otherwise to be marked as required, dependant on certain conditions.
So in short, this is not possible
Comments:
-
Thanks Hobbsy. That is what I was afraid of. - bstutz 8 years ago