Hi All,
I hope you folks are doing well. I’m going a bit nutso, as I need some advice.
So we have a bunch of CFs available for ticket creation, most getting automagically filled with information extracted from emails etc. Now these CF’s aren’t required to be viewed nor touched by the folks attending the tickets.
What I have done is to set View Custom Fields on the specific CFs themselves which they should be able to view and change, whilst not setting them on the ones which should remain ‘hidden’, and that works perfectly. My only problem comes in when attempting to extract this info in the templates…
For example, we have a bunch of Canned Replies for the agents to select… they look something like this:
Hello, thank you for contacting blah blah
Lots of information
For more information please contact:
{ ### CodeBlock 1 Start
my $address = $Ticket->FirstCustomFieldValue(‘Address’);
my $phone = $Ticket->FirstCustomFieldValue(‘Phone’);
my $email = $Ticket->FirstCustomFieldValue(‘Email’);
my $Address = “false”;
my $Phone = “false”;
my $Email = “false”;
if ($address !~ m/NA/) { $Address = “true”}
else { if($address =~ m/NA/) { $Address = “false”}};
if ($phone !~ m/NA/) { $Phone = “true”}
else { if($phone =~ m/NA/) {$Phone = “false”}};
if ($email !~ m/NA/) {$Email = “true”}
else { if ($email =~ m/NA/) {$Email = “false”}};
if ($Address =~ “true”) { $address;}
elsif ($Address =~ “false” && $Phone =~ “true”) { 'Tel.: ’ . $phone; }
elsif ($Address =~ “false” && $Phone =~ “false” && $Email =~ “true”) { 'eMail: ’ . $email };
CodeBlock End
}
Best regard
Out company info
Now, the above works perfectly (there’s a lot more to the scrip, I only extracted part of it to save on space as it is mostly repeated) for folks who can view ALL of the custom fields, but because the Address, Phone, and Email CFs are hidden from the agents the values in those CFs remain blank once the template is executed.
So, long story short, I wanted to know, if y’all know of a way around this little problem, or if I should just let the folks who requested this option know that those fields have to be viewable by the agents.
I’ve done a fair bit of Googling, but my keywords might be off, as I can’t find a solution.
We’re on RT 4.2.9, if that makes a difference.
Cheers,
Nick