[rt-users] Iterating through multi select CF descriptions
Brent Wiese
bwiese at ElementPS.com
Mon Nov 11 14:10:28 EST 2013
Re-ping:
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/20131111/5b07f2db/attachment.htm>
More information about the rt-users
mailing list