Re: [rt-users] Setting the Requestor to be the CurrentUser in a created ticket
Thanks One more reason to switch to 3.8.9 then Gerard On 2011-05-31 17:39, Kevin Falcone wrote: On Tue, May 31, 2011 at 05:32:35PM +0200, Gerard FENELON wrote: 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) Assuming a new enough RT (3.8.9 I think) you can use $TransactionObj to get the CreatorObj of the transaction that triggered your Scrip. That is the correct way to figure out who caused something. -kevin 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
Re: [rt-users] Setting the Requestor to be the CurrentUser in a created ticket
On Tue, May 31, 2011 at 05:32:35PM +0200, Gerard FENELON wrote: >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) Assuming a new enough RT (3.8.9 I think) you can use $TransactionObj to get the CreatorObj of the transaction that triggered your Scrip. That is the correct way to figure out who caused something. -kevin >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 pgpupYvXsxLiz.pgp Description: PGP signature
[rt-users] Setting the Requestor to be the CurrentUser in a created ticket
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