[rt-users] (no subject)

Carlos A. Alvarez carlos.alvarez at commxinc.com
Tue Jul 14 14:27:47 EDT 2009

Yes that is correct.  The reason is that we monitor the status of the ticket for responses.  Some of the tickets that we take are time based, ie LNP orders, so if the requestor doesn't meet the required time to response we auto resolve the ticket. The problem is leaving the status change to the owner, it doesn't always happens, and some valid tickets are being closed due to this little problem.

I appreciate your help.


From: Ken Crocker [mailto:kfcrocker at lbl.gov]
Sent: Tuesday, July 14, 2009 12:25 PM
To: Carlos A. Alvarez
Cc: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] (no subject)


Sounds like you are creating a situation where the ticket status is constantly switched between "open" and "stalled" every time the Requestor and ticket owner communicate to each other. Seems a bit busy but hey, if that's what you want. Try something like this:

Scrip 1 - Owner reply:
Condition: On Correspond

Custom Prep Code:
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $corresponder_id = $trans->CreatorObj->PrincipalId;
my $requestor = $ticket->Requestors->UserMembersObj->First->PrincipalId;
my $owner_id = $ticket->OwnerObj->PrincipalId;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = " ";
my $cf_value = " ";

# set new value for CF Support Status depending on who initiates correspondence

if  ( $corresponder_id = $requestor )
     $cf_name = "Support Status";
     $cf_obj->LoadByName( Name => $cf_name );
     $RT::Logger->debug( "Loaded \$cf_obj->Name = ". $cf_obj->Name() ."\n" );
     $ticket->AddCustomFieldValue( Field=>$cf_obj, Value=>$cf_value, RecordTransaction=>0 );
     $cf_name = "AutoClosure";
     $cf_obj->LoadByName( Name => $cf_name );
     $RT::Logger->debug( "Loaded \$cf_obj->Name = ". $cf_obj->Name() ."\n" );
     $ticket->AddCustomFieldValue( Field=>$cf_obj, Value=>$cf_value, RecordTransaction=>0 );
elseif ( $corresponder_id = $owner )
     $cf_name = "Support Status";
     $cf_value = "Awaiting Customer";
     $cf_obj->LoadByName( Name => $cf_name );
     $RT::Logger->debug( "Loaded \$cf_obj->Name = ". $cf_obj->Name() ."\n" );
     $ticket->AddCustomFieldValue( Field=>$cf_obj, Value=>$cf_value, RecordTransaction=>0 );

return 1;
Custom Cleanup Code:

return 1;

I'm not sure the "ID" part of the code is correct, but the key is to get the Owner & Requestor ids and then compare them to the id of the person doing the correspondence and then based on those results, set your CF's and ticket status. If there is no match, then someone else is doing the correspondence and you want to stop. One scrip to handle all that for correspondence. Hope this helps.


On 7/13/2009 6:59 PM, Carlos A. Alvarez wrote:

I will like to create a scrip where the status of a ticket is automatically changed from open to stalled when a Owner replies to a requestor. I am using rt-crontool to monitor the status of the tickets and auto resolve the ticket after 72 hours of inactivity.  I created a custom field to monitor the status of the crontool, but my problem is that when the customer replies, I can't rely on my techs to change the status of the ticket manually.

I tried creating User Defined Scrip which works fine, exept it executes each time, indiscriminately. Let me try to explain, I have one script that changes the status from open to stalled, when a technician replies, and another that changed the status back to open when the customer/requestor replies.  I can see that both scrips are executing at the same time regardless of who initiated the correspondence.

I know that I am missing something basic, but I don't know what.  Can anyone help.

Scrip 1 customer reply
$self->TicketObj->AddCustomFieldValue(Field => 'Support Status', Value => ' ');
$self->TicketObj->AddCustomFieldValue(Field => 'AutoClosure', Value => ' ');
return 1;

Scrip 2 Owner reply
$self->TicketObj->AddCustomFieldValue(Field => 'Support Status', Value => 'Awaiting Customer');
return 1;





Community help: http://wiki.bestpractical.com

Commercial support: sales at bestpractical.com<mailto:sales at bestpractical.com>

Discover RT's hidden secrets with RT Essentials from O'Reilly Media.

Buy a copy at http://rtbook.bestpractical.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090714/264624a6/attachment.htm>

More information about the rt-users mailing list