<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Looking at my log files when I try to run it I see:<br>
<br>
Apr 10 00:14:04 gamma RT: Couldn't load from the users database. (/opt/rt3/lib/RT/CurrentUser.pm:111)
<br>
<br>
And the relevant snippet of code from CurrentUser.pm:<br>
<br>
sub UserObj {<br>
my $self = shift;<br>
<br>
unless ($self->{'UserObj'}) {<br>
use RT::User;<br>
$self->{'UserObj'} = RT::User->new($self);<br>
unless ($self->{'UserObj'}->Load($self->Id)) {<br>
$RT::Logger->err($self->loc("Couldn't load [_1] from the
users database.\n", $self->Id));<br>
}<br>
<br>
}<br>
return ($self->{'UserObj'});<br>
}<br>
# }}}<br>
<br>
That's as far as I got debugging...hope this helps.<br>
<br>
SteveN<br>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:jason-alexander@uiowa.edu">jason-alexander@uiowa.edu</a> wrote:<br>
<blockquote type="cite"
cite="mid1049943194.3e94dc9a3c487@webmail2.its.uiowa.edu">
<pre wrap="">Hello all,
First of all I will admin that I am not very good with Perl. It's something I
am trying to learn in my non-existent free time.
Tonight I saw Jesse's Buglist.html. This was the one thing that was keeping my
boss from letting me move our security database to RT. So I started hacking
away. What I was trying to accomplish was to simply print out new and open
tickets from all the queues for our help desk to look at. I got most of this
working except for one problem. We have about 15 Global Custom fields that we
use in our tickets. But for the life of me I can't get any of the values to
print out. I'm sure I'm just not calling something correctly. And I'm sure
it's probably a 5 minute thing but I don't have any idea.
I tried to use the serverity field as an example changing the values to my
global field but I don't get anything when buglist displays.
I have attached my modified source to buglist.html. Can anyone tell me or show
me an example of out to get the values of custome field out.
thanks
Jason
</pre>
<br>
<hr width="90%" size="4"><br>
<link rel="stylesheet" href="/NoAuth/webrt.css" type="text/css">
<title>Buglist</title>
<h1> Current new and open tickets.</h1>
<table width="100%" cellspacing="0" cellpadding="3" border="0">
<%PERL> my $tickets = new RT::Tickets($user); $tickets->LimitStatus(VALUE
=> 'open'); $tickets->LimitStatus(VALUE => 'new'); $tickets->OrderBy(FIELD
=> 'id', ALIAS => 'main', ORDER => 'ASC'); <!--%PERL--> % if ($tickets->Count)
{ <tbody>
<tr>
<td bgcolor="#336699"><font color="#ffffff" size="+1"> <b>Subject<b> </b></b></font>
</td>
<td bgcolor="#336699"><font color="#ffffff" size="+1"> <b>Status<b> </b></b></font></td>
<td bgcolor="#336699"><font color="#ffffff" size="+1"> <b>Queue<b> </b></b></font></td>
<td bgcolor="#336699"><font color="#ffffff" size="+1"> <b>Room<b> </b></b></font></td>
</tr>
%while (my $ticket = $tickets->Next) { % $i++; % my $room = $ticket->CustomFieldValues($room_sel->id)->First;
<tr %="" if="" ($i%2="" {="" bgcolor="#eeeeee">
<td> <%$ticket->Id%> <%$ticket->Subject%> </td>
<td> <%$ticket->Status%> </td>
<td> <%$ticket->QueueObj->Name%> </td>
<td <%$room&&$room="">Content%> </td>
</tr>
% } % }
</tbody>
</table>
<%INIT> my $user = new RT::CurrentUser('guest'); my $queue =
new RT::Queue($user); my $i; my $room_sel= RT::CustomField->new($user);
$room_sel->LoadByNameAndQueue(Name =>'Room', Queue => $queue->Id);
<!--%INIT--> </blockquote>
<br>
</body>
</html>