[rt-users] Trouble: I need to parse the issue ticket

Bjoern Schulz bjoern.schulz at desy.de
Mon May 24 08:48:43 EDT 2010


check that:

http://wiki.bestpractical.com/view/ClassObjectsMethods
http://wiki.bestpractical.com/view/GlobalObjects
http://wiki.bestpractical.com/view/ObjectModel

or try one of the great bps training sessions with jesse.


-bjoern

Am 24.05.2010 02:43, schrieb Pablo Silva:
> Yes, now works!!, where I can find documentation about methods and
> object more ilustrative..?, because it's not easy to read the perldoc
> xxx.pm, there's some tutorial for to learn about object's, methods?
>
> Thanks in advance!
> -Pablo
>
>
> On Sat, May 22, 2010 at 12:11 PM, Bjoern Schulz<bjoern.schulz at desy.de>  wrote:
>> hi,
>>
>> check that
>> http://wiki.bestpractical.com/view/ExtractCustomFieldValues
>>
>> For me it works fine.
>>
>>
>> -bjoern
>>
>> Am 22.05.2010 17:31, schrieb Pablo Silva:
>>>
>>> Hi!, I would like to parse the issue Ticket on the Create event,
>>> because inside the e-mail i need to search word Precio and to get the
>>> Value, for Example:
>>>
>>> [root at rt ~]# mail rt-compras at rt.osa.cl
>>> Subject: Test
>>>
>>> Bla bla
>>>
>>> Precio: 2000
>>>
>>> .
>>> Cc:
>>> [root at rt ~]#
>>>
>>> Send an e-mail to rt.
>>>
>>> I use this code but dosen't work, and don't know why.., the code is:
>>>
>>> $self->TransactionObj->Content()  =~ /Precio: (.*) /i
>>>
>>> That's my scrip on rt 3.8.7
>>>
>>> Condition: On Create
>>> Action: User Define
>>> Template: Global Template Blank
>>> Stage: Transaction Stage
>>>
>>> Custom action preparation code:
>>>
>>> my $precio=0;
>>>
>>> if ($self->TransactionObj->Content()  =~ /Precio: (.*) /i ) {
>>>    $precio=$1
>>> }
>>>
>>> $RT::Logger->debug("Que es esto? " . $self->TransactionObj->Content() );
>>>
>>>
>>> $self->TicketObj->AddCustomFieldValue( Field =>    'Precio', Value =>
>>>   $precio );
>>>
>>> return 1;
>>>
>>>
>>> Custom action cleanup code:
>>>
>>> my $funcionario;
>>> $funcionario="";
>>>
>>> if ($self->TicketObj->FirstCustomFieldValue('Precio')  le 200){
>>>     $funcionario="cfigueroa";
>>> } else {
>>>     $funcionario="msilva";
>>> }
>>>
>>> $self->TicketObj->SetOwner($funcionario,'Give');
>>> $self->TicketObj->SetQueue("General");
>>>
>>> return 1;
>>>
>>>
>>> Thanks in advance..
>>>
>>> Pablo
>>>
>>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>>> Buy a copy at http://rtbook.bestpractical.com
>>
>> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>> Buy a copy at http://rtbook.bestpractical.com
>>



More information about the rt-users mailing list