
theillien at yahoo
Jan 13, 2007, 11:27 PM
Post #1 of 1
(482 views)
Permalink
|
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: <snip> 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; } </snip> 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 _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: sales [at] bestpractical Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
|