> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Keith Edmunds > Sent: Sunday, December 10, 2006 1:27 PM > To: [email protected] > Subject: Re: [rt-users] CommandByMail and Custom Fields > > I've done a bit more research on this, and to keep it simple I created > an "Enter one value" custom field called 'Textline'. > > I added some debug lines to TakeAction.pm as follows (my lines marked > ">>>"): > > # Canonicalize custom fields > >>> $RT::Logger->warning("X1"); > my $custom_fields = $queue->TicketCustomFields; > while ( my $cf = $custom_fields->Next ) { > >>> $RT::Logger->warning("X2: cf=$cf"); > my %tmp = _ParseAdditiveCommand( \%cmds, 0, > "CustomField{". > $cf->Name ."}" ); next unless keys %tmp; > $create_args{ 'CustomField-' . $cf->id } = > [ _CompileAdditiveForCreate(%tmp) ]; } > > When I create a new ticket with the mail below, the status is set to > 'stalled' (so it looks as if the mail is being parsed), the 'X1' line > above is logged, but there is no 'X2' line logged. It looks to me as > if $queue->TicketCustomFields is not returning the custom fields for > this queue. > > I don't know Perl very well so I'm not sure how to examine what > "custom_fields" is sent to - a simple output of that variable to the > log shows it is "RT::CustomFields=HASH(0x9bf5044)"
Keith, The value "RT::CustomFields=HASH(0x9bf5044)" just shows you that the variable is an object of type RT::CustomFields. You can get more info about the object by using the appropriate methods & attributes for that object. These are in CustomFields_Overlay.pm, CustomFields.pm, RT::SearchBuilder, and DBIx::SearchBuilder. For example you can see how many custom fields are represented by this object by logging $custom_fields->Count just before the loop. The fact that the X2 line doesn't get logged indicates that there are no CF objects in $custom_fields. A couple of reasons why this might be true: the queue has no ticket custom fields defined or it could be a permissions issue. Steve ---------------------------------------- Stephen Turner Senior Programmer/Analyst - Client Support Services MIT Information Services and Technology (IS&T) _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
