[rt-users] Setting the Requestor to be the CurrentUser in a created ticket

Gerard FENELON gerard at eve-team.com
Tue May 31 11:32:35 EDT 2011


Hello

I am creating tickets automatically when a CF is set to a specific value

I would like to to put the name of the User that changes the CF value in 
the Content.
I would also like to set the Requestor of the new ticket to be the User 
that changes the CF value
I have been unable to find a way to do that (I searched the wiki)

The (simplified) template to create that new ticket is below
(for the moment I am just trying to get the name of the CurrentUser in 
the Content part
I will set the Requestor once I get that part right)

I have tried

    * new RT::CurrentUser( $session{'CurrentUser'} );
    * new RT::CurrentUser;
    * $session{'CurrentUser'}
    * $Tickets{'TOP'}->CurrentUser

none of them seems to give me the expected result
(the first three return nothing, the last returns the SystemUser)
Can someone help me out ?

Thanks
Gerard

===Create-Ticket: new_patch_request
Queue: Patch Request
Subject: patch for RT { $Tickets{'TOP'}->Id() }
RefersTo: {  $Tickets{'TOP'}->Id() }
CustomField-4:  { $Tickets{'TOP'}->FirstCustomFieldValue( 'SW' ) || 
"Unknown" ; }
Content:

{ my $current_user = ????? ;
$current_user->RealName if $current_user  }

is requesting an official patch for ticket { $Tickets{'TOP'}->Id() } 
(Subject: { $Tickets{'TOP'}->Subject }).

ENDOFCONTENT


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110531/866c0949/attachment.htm>


More information about the rt-users mailing list