[rt-users] Iterating through multi select CF descriptions
Brent Wiese
bwiese at ElementPS.com
Mon Oct 14 20:25:45 EDT 2013
Running RT 4.0.17.
I have a CF that is a multi-select.
I use the description field to determine whether to fire off certain checks in a scrip.
What I can't seem to figure out is how to check every one of the chosen item's description.
If I try this, a slight modification of another case where I iterate through the chosen values ($INTval->Content):
my $ticket = $self->TicketObj;
my $cfINTvals = $ticket->CustomFieldValues($cfINT);
while ( my $INTval = ($cfINTvals->Next) ) {
if ($INTval->Description eq 'xyz') {
It fails with:
Prepare failed: RT::ObjectCustomFieldValue::Description Unimplemented in RT::Action::UserDefined.
I used to use this, but it no longer suffices as it only checks the first chosen field description:
my $value_obj = RT::CustomFieldValue->new( $ticket->CurrentUser );
$value_obj->LoadByCols(CustomField => $cfid, Name => $ticket->FirstCustomFieldValue($cfid));
my $desc = $value_obj->Description;
if ($desc eq 'xyz') {
I tried this, a variation of both (chaning FirstCustomFieldValue to CustomFieldValues and trying to Next them):
my $value_obj = RT::CustomFieldValue->new( $ticket->CurrentUser );
$value_obj->LoadByCols(CustomField => $cfINT, Name => $ticket->CustomFieldValues($cfINT));
while ( my $desc = ($value_obj->Next)) {
my $descval = $desc->Description;
if ($descval eq 'xyz') {
But it fails with:
Prepare failed: RT::CustomFieldValue::Next Unimplemented in RT::Action::UserDefined.
I'm hoping this is something really obvious I'm just not seeing after 2 days of pulling out my hair...
Thanks in advance for any suggestions.
Brent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20131015/bf04b20b/attachment.htm>
More information about the rt-users
mailing list