[rt-users] Most efficient way to update custom fields without creating too many transactions

Landon Stewart lstewart at iweb.com
Mon Aug 26 16:55:36 EDT 2013


Hello,

Currently we are utilizing some internal systems to lookup the Customer ID
and other data related to that customer to add to Incident Reports coming
into RT.  Some organizations include a list of IP addresses or URLs related
to a specific type of Incident.  Those IP addresses or URLs might belong to
several customers and the processing of the ticket becomes more arduous to
process by my Action modules.  While this is not a problem in itself
because it eventually does get processed the processing also adds a number
of of Transactions that is multiples of the required custom fields to be
updated.

For example if there are 1000 IP addresses in a ticket and there are 4
custom fields to be updated it creates 4000 transactions for that one
ticket when looping each update individually.

What I'm wondering is if there's a better way to make these updates so
multiple values can be added to the ticket with one transaction.

Example:

*This:*
foreach my $customerID (@customerids) {
  $ticket->AddCustomFieldValue( Field => 'Customer', Value => $customerID );
}

Vs. This:
$ticket->AddCustomFieldValue( Field => 'Customer', Value =>
join("\n", at customerids) );

I noticed the "Content" field in the ObjectCustomFieldValues table is
limited to varchar(255) so the second psudo-code example above would
probably not be a good idea.

ALSO - If anyone has advice on how to split incoming tickets for tons of IP
address into individual tickets please let me know.  I have an idea of how
I'm going to do it already based on some parsing and create perl code but
there's always more than one way to skin a cat.

In fact, having just re-read what I wrote above, I think I might be going
about this incorrectly.  Perhaps I should not be adding ALL the data per
Incident Report but rather per Incident.  I should probably restrict the
data added to the Incident Report to just Customer ID only.  Perhaps the
single report having many IP addresses listed should be linked to a new
Incident per customer instead of creating multiple Incident Reports.  That
actually makes more sense.

Thanks for reading!  Any feedback is appreciated.

-- 
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/rt-users/attachments/20130826/b65d55f8/attachment.htm>


More information about the rt-users mailing list