[rt-users] Integrating RT w/ SugarCRM information

Adam Thick adam.thick at strategicdata.com.au
Tue Nov 5 19:56:08 EST 2013


Hi Gary,

we have used a script to add client information ( from a custom field ) in RT based on the incoming email address.

Is this the sort of thing you're after? I imagine you could make a call in the middle there to get values from your CRM.

{

#test create
return 0 unless $self->TransactionObj->Type eq "Create"; #only assign on create
return 0 if $self->TicketObj->FirstCustomFieldValue('Client'); # and if there's no client defined already

my $ticket = $self->TicketObj;
my $cf = RT::CustomField->new($RT::SystemUser);
my $requestor = $ticket->RequestorAddresses;

$requestor =~ /(^.+)@([^\.].*\.[a-z]{2,}$)/;
# $1 returns the username, $2 returns the domain name
my $cf_value = $2;

$cf->LoadByName(Name => 'Skip Auto Assign'); #we do not want to auto assign some clients
my $skaa_values = $cf->Values;
return 0 if !$cf->id;

while ( my $v = $skaa_values->Next ) {
    next if ! $v->Name || $v->Name eq '';
    if ($v->Name eq $cf_value) {
         return 0;
   }
}

$cf->LoadByName(Name => 'Client'); #Load up the client custom field
my $cf_values = $cf->Values;
return 0 if !$cf->id;

while ( my $v = $cf_values->Next ) {
    next if ! $v->Name || $v->Name eq '';
    if ($v->Name eq $cf_value) {
        $cf->AddValueForObject( Object => $ticket, Content => $cf_value); # if the incoming client matches add it to the ticket
        return 1;
    }
}

return 0;

}

Cheers,
Adam T.

On 03/11/2013, at 3:45 AM, Garry Glendown <garry at glendown.de> wrote:

> Hi,
> 
> after using OTRS for a couple years, we're thinking about moving (back)
> to RT ... while I assume we can get the other custom stuff we set up in
> OTRS (billing information for tickets, etc.) to work, and already have
> some basic stuff (like Authentication to our internal LDAP) running, I'm
> currently looking into integrating RT with our SugarCRM database ... we
> currently get customer info  based on customer EMails (including
> customer ID, phone number, company name etc.) to display with a ticket
> in OTRS. I'd like to get this into RT ... a search on the net only came
> up with a couple other people looking for using RT instead of the
> ticketing of the CRM ...
> Does anybody have any pointers on whether and how to get this working?
> 
> Thanks, Garry
> 
> -- 
> PGP Fingerprint: A79F A33F 5B13 BEB7 A51D 274F F99C 3AE2 4BCB 7015	
> 




More information about the rt-users mailing list