Transactions

If a new tickets is created, with the status set to ‘resolved’,
is the only entry made in the ‘transactions’ table about
the being created, i.e of type ‘Created’?

(rt 2.0.9)

Hi,

my colleague realized, that info in Dates box differs from info in the
Ticket History (they weren’t displayed in localtime). Here is the fix.
The problem also appeared in the Results box just after Submitting the
change.

— Transaction.pm.orig Wed Mar 6 16:26:51 2002
+++ Transaction.pm Wed Mar 6 16:31:09 2002
@@ -644,6 +644,15 @@
return ($self->Field . " changed from " . $q1->Name . " to ".
$q2->Name);
}

  •    # Write the date/time change at local time:
    
  •    elsif ($self->Field =~  /Due|Starts|Started|Told/) {
    
  •        my $t1 = new RT::Date($self->CurrentUser);
    
  •        $t1->Set(Format => 'ISO', Value => $self->NewValue);
    
  •        my $t2 = new RT::Date($self->CurrentUser);
    
  •        $t2->Set(Format => 'ISO', Value => $self->OldValue);
    
  •        return ($self->Field . " changed from " . $t2->AsString .
    
  •                " to ".$t1->AsString);
    
  •    }
      else {
          return ($self->Field . " changed from " . $self->OldValue .
                  " to ".$self->NewValue);
    

— cut here :wink:

Jan Okrouhly
-----------------------------------------+---–okrouhly@civ.zcu.cz—
Laboratory for Computer Science | phone: (420 19) 7491588
University of West Bohemia | location: Univerzitni 22
Americka 42, 306 14 Pilsen, Czech Republic | room: UI404
------------------------------------------73!-de-OK1INC@OK0PPL.#BOH.CZE.EU-

Thanks. Applied.On Wed, Mar 06, 2002 at 04:37:47PM +0100, Jan Okrouhly wrote:

Hi,

my colleague realized, that info in Dates box differs from info in the
Ticket History (they weren’t displayed in localtime). Here is the fix.
The problem also appeared in the Results box just after Submitting the
change.

— Transaction.pm.orig Wed Mar 6 16:26:51 2002
+++ Transaction.pm Wed Mar 6 16:31:09 2002
@@ -644,6 +644,15 @@
return ($self->Field . " changed from " . $q1->Name . " to ".
$q2->Name);
}

  •    # Write the date/time change at local time:
    
  •    elsif ($self->Field =~  /Due|Starts|Started|Told/) {
    
  •        my $t1 = new RT::Date($self->CurrentUser);
    
  •        $t1->Set(Format => 'ISO', Value => $self->NewValue);
    
  •        my $t2 = new RT::Date($self->CurrentUser);
    
  •        $t2->Set(Format => 'ISO', Value => $self->OldValue);
    
  •        return ($self->Field . " changed from " . $t2->AsString .
    
  •                " to ".$t1->AsString);
    
  •    }
      else {
          return ($self->Field . " changed from " . $self->OldValue .
                  " to ".$self->NewValue);
    

— cut here :wink:

Jan Okrouhly
-----------------------------------------+---–okrouhly@civ.zcu.cz—
Laboratory for Computer Science | phone: (420 19) 7491588
University of West Bohemia | location: Univerzitni 22
Americka 42, 306 14 Pilsen, Czech Republic | room: UI404
------------------------------------------73!-de-OK1INC@OK0PPL.#BOH.CZE.EU-


rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

I’m writing a script which will make use of the RT API to access the database,
iterate through each transaction created during a period of time, determine if
the creator was a particular user and if so, add the TimeTaken to a hash. I can
see that Transaction.pm contains these objects. What I don’t know is how to
access them.

I’m starting out with this:

my @usrID;

my $users = new RT::Users(RT::SystemUser);
$users->LimitToPrivileged;

while ( my $user = $users->Next ) {
next if $user->Name eq ‘root’;
push @usrID, $user->id;
}

foreach my $id (@usrID) {
print $id . “\n”;
}

my $trnsObj = new RT::Transaction(RT::SystemUser);
$trnsObj->Creator;
while ( my $trans = $trnsObj->Next) {
print $trans->id;
}

This doesn’t work though as there is no ‘Next’ method in Transaction. How would
I do this? I guess what I need is a method that will gather up all of the
transactions by a given user.

If someone else has created a sort to timesheet script similar to what I’m
trying to do I’d be appreciative if I could look at it as an example. Any other
help will also be appreciated.

Mathew