[rt-users] Problem with date

Bryon Baker bbaker at copesan.com
Thu Nov 20 09:40:03 EST 2014


The time zone is configured correctly.

Maybe I state the issue wrong in the current configuration when a ticket is closed the TimeWorked and the Resolved date are not updated.  

Is there a configuration I need to add to turn on this automated feature?

All other dates seem to be populating. Created, Started, Last Contact, Updated and they are showing the correct dates.  But when a ticket is closed the "closed date" does not get populated nor does the timework.

Thanks
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726  .  262-783-6261 ext. 2296
bbaker at copesan.com
www.copesan.com
"Servicing North America with Local Care"


-----Original Message-----
From: Christian Loos [mailto:cloos at netcologne.de] 
Sent: Thursday, November 20, 2014 8:33 AM
To: Bryon Baker; RT Users (rt-users at lists.bestpractical.com)
Subject: Re: Problem with date

RT saves dates in the DB in UTC.

In the web interface dates are displayed based on the RT_SiteConfig.pm [1] or User timezone.

Maybe just your timezone config is wrong.

Chris

[1] http://bestpractical.com/docs/rt/latest/RT_Config.html#Timezone

Am 20.11.2014 um 15:17 schrieb Bryon Baker:
> Thanks for your response Christian.
> 
> So where it RT is that configuration?
> 
> This is why I developed the script to update the resolved date and timeworked.  I have been trying to get this to work for months and I have completely missed the configuration you are talking about. 
> 
> Thanks
> Bryon Baker
> Network Operations Manager
> Copesan - Specialists in Pest Solutions
> 800-267-3726  .  262-783-6261 ext. 2296 bbaker at copesan.com 
> www.copesan.com "Servicing North America with Local Care"
> 
> -----Original Message-----
> From: Christian Loos [mailto:cloos at netcologne.de]
> Sent: Thursday, November 20, 2014 1:52 AM
> To: Bryon Baker; RT Users (rt-users at lists.bestpractical.com)
> Subject: Re: Problem with date
> 
> Hi,
> 
> as far as I understand you script you try to set the ticket resolved date to the transaction date when the ticket status is set to closed.
> 
> If you have configured you RT correct this is done automatically by RT.
> 
> So what is your intent with this script?
> 
> Chris
> 
> Am 19.11.2014 um 20:18 schrieb Bryon Baker:
>> I am attempting use  the following code to update the Resolved date 
>> in a ticket.  Thanks for the help in advance.
>>
>>  
>>
>> package RT::Action::CSRUpdateResolvedTest;
>>
>> use base 'RT::Action';
>>
>> use strict;
>>
>> use warnings;
>>
>>  
>>
>> sub Prepare
>>
>> {
>>
>>                 return 1;
>>
>> }
>>
>>  
>>
>> sub Commit
>>
>> {
>>
>>                
>>
>>                 my %mon2num = qw(
>>
>>                                 jan 1  feb 2  mar 3  apr 4  may 5  
>> jun
>> 6
>>
>>                                 jul 7  aug 8  sep 9  oct 10 nov 11 
>> dec
>> 12
>>
>>                 );
>>
>>                 my $self = shift;
>>
>>                 my $ticket = $self->TicketObj;
>>
>>                 my $datecreated = $ticket->CreatedObj->Unix;
>>
>> my $dateupdated = $ticket->LastUpdatedObj->Unix;
>>
>> my $datecreatedstr = $ticket->CreatedObj->AsString;
>>
>> my $dateupdatedstr = $ticket->LastUpdatedObj->AsString;
>>
>>                 my $dateresolved;
>>
>>                 my $dateresolvedstr;
>>
>>                 my @dateresolvedstr;
>>
>>                 my $transactions = $ticket->Transactions;
>>
>>                 $transactions->Limit( FIELD => 'Type', VALUE => 
>> 'Status', FIELD => 'NewValue', VALUE => 'closed');
>>
>>                 while (my $transaction = $transactions->Next)
>>
>>                 {
>>
>>             $dateresolved = 
>> localtime($transaction->CreatedObj->Unix);
>>
>>                            @dateresolvedstr = split(" 
>> ",$dateresolved);
>>
>>                            $dateresolvedstr = $dateresolvedstr[4] . "-"
>> . $mon2num{lc substr($dateresolvedstr[1], 0, 3)} . "-" .
>> $dateresolvedstr[2] . " " .  $dateresolvedstr[3];
>>
>>                  }
>>
>>  
>>
>>                 print $dateresolvedstr . " " . $dateresolved . "\n";
>>
>>                 $ticket->SetResolved($dateresolvedstr);
>>
>>  
>>
>>                 return 1;
>>
>> }
>>
>>  
>>
>> The dates printed to the console are correct but when I view the 
>> ticket the resolved date is different than the dates printed to the 
>> console by
>> 6 hours.  This seems to me to be the off set for the time zone.  What 
>> do I need to add for Request Tracker to take the date as is?
>>
>>  
>>
>> Thanks
>>
>> Bryon Baker
>>
>> Network Operations Manager
>>
>> */Copesan/**/- Specialists in Pest Solutions/*
>>
>> 800-267-3726  .  262-783-6261 ext. 2296
>>
>> bbaker at copesan.com <mailto:cstephan at copesan.com>
>>
>> www.copesan.com <http://www.copesan.com/>
>>
>> */"Servicing North America with Local Care"/*
>>
>>  
>>
> 
> 




More information about the rt-users mailing list