[rt-devel] RE: Changing ticket creation to current user

Max Bowsher maxb at ukf.net
Sat Dec 6 07:16:58 EST 2003

John Schubert wrote:
> On Thu, 2003-12-04 at 19:45, Robert Spier wrote:
>>> to
>>> ... Default => $session{'CurrentUser'}||undef &>
>>> I searched the archives and didn't see anything down this road, but I
>>> can't be the first person that's wanted the owner to default to the
>>> logged in user.  Anyone else changed this?
>> Try it... but I'm pretty sure you'll need:
>> $session{'CurrentUser'}->Id()
>> (judging by the code in Elements/SelectOwner
> I tried it both ways and no dice.  I obviously dont understand the
> default selection and it's interaction with mod_perl.  On a separate
> line I could use
> <% $session{'CurrentUser'}->Name %>
> and see the name of the person who was logged in.  If I substituted this
> string (with or without <% enclosing) for either the "undef" or
> $session{'Current...}  it either ignored it or broke it (error upon
> compilation).
> So I'm close.  I know the variable is $sesson...Name, just no clue where
> to paste it in.  All my Perl books are at home and my O-Reilly "Writing
> Apache Modules" mod_perl pullout didn't help much.  I'm not sure I'd
> have figured it out with my books anyway :-) as I've only worked with
> Perl for about 3 months.

In Ticket/Create.html:
In the <& /Elements/SelectOwner, ... &> tag:
Change: $ARGS{Owner}||undef
To:     $ARGS{Owner}||$session{'CurrentUser'}->Id()||undef

> FWIW, ID gave the ID of the user (in this case, 37, which is odd because
> there aren't more than 13 users), and using Id() broke the code.

No, its not odd, because groups are also assigned Ids from the same


More information about the Rt-devel mailing list