From Request Tracker Wiki
Jump to: navigation, search

Solution for User Password + Viewing ticket status

The following template will send users an auto-generated random pronounceable password if inserted into an autoreply template. Users who have previously submitted tickets but not yet had a password assigned will have a password assigned and sent on submission of their first new ticket. (All previous tickets will still show up in the web ui) --JesseVincent

Add this line to the if statement if you do not want to auto generate a password for people that logon using ldap credentials from your domain. I had to do this because I am using RT::Authen::ExternalAuth.

($Ticket->RequestorAddresses !~ m/$/i) &&

Note: fixed variable case error below as described at;#26492

Subject: AutoReply: {$Ticket->Subject}
 This message has been automatically generated in response to the
 creation of a helpdesk call:
 a summary of which appears below.
 There is no need to reply to this message right now. Your ticket has been
  assigned an ID of [{$rtname} #{$Ticket->id()}]. Please include this string
 in the subject line of all future correspondence about this issue.
 *RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar;
 if (($Transaction->CreatorObj->id != $RT::Nobody->id) &&
     (!$Transaction->CreatorObj->Privileged) &&
     ($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*')
     ) {
         my $user = RT::User->new($RT::SystemUser);
         my ($stat, $pass) = $user->SetRandomPassword();
         if (!$stat) {
                 $OUT .=
 "An internal error has occurred. RT was not able to set a password for you.
 Please contact your local RT administrator for assistance.";
 $OUT .= "
 You can check the current status and history of your requests at:
 When prompted, enter the following username and password:
         Username: ".$user->Name."
         Password: ".$pass."
                         Thank you.