[rt-users] problem extracting custom field values

Hugo Escobar hescobar at afslc.com
Thu Apr 18 02:38:31 EDT 2013


Hi there:

I'm writing a little piece of code to avoid storing duplicate values in
custom fields.
The custom field in reference is of 'multiple values' type.

I do the following:

my $CFValues = $Ticket->CustomFieldValuesAsString($cf_name);

if ($CFValues=~/$val/ms) {
    # do not save the cf value
}
else {
    # save the cf value
}

What's really weird is if the custom field currently has one value,
the code above seems to be completely ignored. If there's more than
one value, it does exactly what i need it to do.

This happens when it runs in a callback i wrote which is called by
'Ticket/Update.html'

When i run the same snippet in a cli script it works always.

I'm totally clueless about what is causing this situation, after spending
countless hours i haven't solved this problem.

Any help will be greatly appreciated

-- 
Hugo Escobar


[image: AFS_logo.png]

Follow us on Facebook and Linked-In

[image: facebook-24x24.png]<http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864>
 [image: linkedin-24x24.png] <http://www.linkedin.com/companies/1006276>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130418/b754c555/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin-24x24.png
Type: image/png
Size: 875 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130418/b754c555/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AFS_logo.png
Type: image/png
Size: 3183 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130418/b754c555/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook-24x24.png
Type: image/png
Size: 814 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130418/b754c555/attachment-0002.png>


More information about the rt-users mailing list