[Rtir] Using ->DeleteCustomFieldValue() on the 'IP' CF does not work like ->AddCustomFieldValue() ?
Landon Stewart
lstewart at iweb.com
Mon Aug 11 13:32:16 EDT 2014
On 11 August 2014 09:38, Kevin Falcone <falcone at bestpractical.com> wrote:
Hi Kevin,
Thanks for replying to me. See below for the information you mentioned in
your post.
> On Fri, Aug 08, 2014 at 11:34:13AM -0700, Landon Stewart wrote:
> > Hello RTIR,
> >
> > I've borrowed the code from RTIR_FindIP.pm and modified it so I can
> specify the
> > ticket object to Add and Delete IP addresses. This is so I can iterate
> through
> > child tickets of an Incident and perform the same action on them. I can
> add IP
> > addresses to CF.{IP} but not delete IP addresses though. I'm stumped.
> Any
> > clues about how to delete an IP address from the IP custom field?
>
> Your line numbers don't line up with the current RT release, so
> debugging this is kind of impossible
>
> https://github.com/bestpractical/rt/blob/stable/lib/RT/ObjectCustomFieldValue.pm#L169
Sorry - I'm using RT v4.0.17 with RTIR v3.0.0rc1. Nothing in the release
of either RT or RTIR was modified but new modules have been added. The one
I'm dealing with right now is called
local/plugins/RT-IR/lib/RT/Action/RTIR_UpdatePF.pm
I've pasted my code at http://pastebin.com/raw.php?i=APb1ZEPz with some
modifications (the external database call to grab customer data has been
removed).
> Please provide your RT release, your RTIR release, local modifications
> made and enable Stacktraces to better highlight your error.
> http://bestpractical.com/docs/rt/latest/RT_Config.html#LogStackTraces
I've enabled $StackTraces with a value of 5 now. Not sure if this provides
enough information since it doesn't really indicate what the error might be.
*The resulting log entries after running this via:*
/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL --action
RT::Action::RTIR_iWebUpdatePF --transaction first --search-arg "id =
16735422"
*Are: **(xx.x05.127.6 purposely obfuscated)*
[Mon Aug 11 17:08:46 2014] [critical]: RT::CustomField::ParseIPRange
Unimplemented in RT::ObjectCustomFieldValue.
(/opt/rt4/bin/../lib/RT/ObjectCustomFieldValue.pm line 169)
(/opt/rt4/bin/../lib/RT.pm:400)
Trace begun at /opt/rt4/bin/../lib/RT.pm line 294
Log::Dispatch::crit('Log::Dispatch=HASH(0x40eaaf0)',
'RT::CustomField::ParseIPRange Unimplemented in RT::ObjectCustomFieldValue.
(/opt/rt4/bin/../lib/RT/ObjectCustomFieldValue.pm line 169) ^J') called at
/opt/rt4/bin/../lib/RT.pm line 400
RT::__ANON__('RT::CustomField::ParseIPRange Unimplemented in
RT::ObjectCustomFieldValue.
(/opt/rt4/bin/../lib/RT/ObjectCustomFieldValue.pm line 169) ^J') called at
/usr/share/perl5/DBIx/SearchBuilder/Record.pm line 494
DBIx::SearchBuilder::Record::AUTOLOAD('RT::CustomField=HASH(0x822b700)',
xx.x05.127.6) called at /opt/rt4/bin/../lib/RT/ObjectCustomFieldValue.pm
line 169
RT::ObjectCustomFieldValue::LoadByCols('RT::ObjectCustomFieldValue=HASH(0x8228228)',
'Content', xx.x05.127.6, 'CustomField', 68, 'ObjectType', 'RT::Ticket',
'ObjectId', 16735422, 'Disabled', 0) called at
/opt/rt4/bin/../lib/RT/ObjectCustomFieldValue.pm line 217
RT::ObjectCustomFieldValue::LoadByObjectContentAndCustomField('RT::ObjectCustomFieldValue=HASH(0x8228228)',
'Object', 'RT::Ticket=HASH(0x805fdd8)', 'Content', xx.x05.127.6,
'CustomField', 68) called at /opt/rt4/bin/../lib/RT/CustomField.pm line 1654
RT::CustomField::DeleteValueForObject('RT::CustomField=HASH(0x822a1e8)',
'Object', 'RT::Ticket=HASH(0x805fdd8)', 'Id', undef, 'Content',
xx.x05.127.6) called at /opt/rt4/bin/../lib/RT/Record.pm line 1857
RT::Record::DeleteCustomFieldValue('RT::Ticket=HASH(0x805fdd8)', 'Value',
xx.x05.127.6, 'Field', 'RT::CustomField=HASH(0x81eed50)') called at
/opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_UpdatePF.pm line 83
RT::Action::RTIR_UpdatePF::RemIP('RT::Action::RTIR_UpdatePF=HASH(0x8072dd0)',
'Ticket', 'RT::Ticket=HASH(0x805fdd8)', 'IP', xx.x05.127.6, 'CustomField',
'RT::CustomField=HASH(0x81eed50)', 'Skip', 'HASH(0x804ef98)') called at
/opt/rt4/local/plugins/RT-IR/lib/RT/Action/RTIR_UpdatePF.pm line 46
RT::Action::RTIR_UpdatePF::Commit('RT::Action::RTIR_UpdatePF=HASH(0x8072dd0)')
called at /opt/rt4/bin/rt-crontool line 227X
main::process('RT::Ticket=HASH(0x805fdd8)',
'RT::Transaction=HASH(0x8077500)', undef) called at
/opt/rt4/bin/rt-crontool line 176
--
Landon Stewart :: lstewart at iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rtir/attachments/20140811/f822bd82/attachment.html>
More information about the rtir
mailing list