<div dir="ltr"><div><div><div><div>Hi there:<br><br></div>I'm writing a little piece of code to avoid storing duplicate values in custom fields.<br></div><div>The custom field in reference is of 'multiple values' type.<br>

</div><div><br></div>I do the following:<br><br>my $CFValues = $Ticket->CustomFieldValuesAsString($cf_name);<br></div><br>if ($CFValues=~/$val/ms) {<br></div>    # do not save the cf value<br><div>}<br></div><div>else {<br>

</div><div>    # save the cf value<br></div><div>}<br clear="all"></div><div><div><div><div><div><br></div><div>What's really weird is if the custom field currently has one value,<br></div><div>the code above seems to be completely ignored. If there's more than<br>

</div><div>one value, it does exactly what i need it to do.<br><br></div><div>This happens when it runs in a callback i wrote which is called by 'Ticket/Update.html'<br><br></div><div>When i run the same snippet in a cli script it works always.<br>

</div><div><br></div><div>I'm totally clueless about what is causing this situation, after spending countless hours i haven't solved this problem.<br><br></div><div>Any help will be greatly appreciated<br><br></div>

<div>-- <br>Hugo Escobar<br><br><br><img title="AFS_logo.png" alt="AFS_logo.png" src="cid:ii_12ddc99660bf2d8d" width="171" height="35"><br><br>Follow us on Facebook and Linked-In<br clear="all"><br><a href="http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864" target="_blank"><img title="facebook-24x24.png" alt="facebook-24x24.png" src="cid:ii_12ddc9e6256d137a"></a> <a href="http://www.linkedin.com/companies/1006276" target="_blank"><img title="linkedin-24x24.png" alt="linkedin-24x24.png" src="cid:ii_12ddc9cb29a3a5d5"></a><br>


</div></div></div></div></div></div>