RT 3.6.4 - Template Autogenerate Password

Hello everybody!

I have the following template for autogenerating user and password after
creating a new ticket:

{
*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);
$user->Load($Transaction->CreatorObj->Id);
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:

“.$RT::WebURL.”

When prompted, enter the following username and password:

Username: ".$user->Name.“
Password: “.$pass.”
”;
}
}

How can I add this user to a group automatically in this script?

Thanks,
Andreas

Hello everybody!

I have the following template for autogenerating user and password after
creating a new ticket:

{
*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);
$user->Load($Transaction->CreatorObj->Id);
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:

“.$RT::WebURL.”

When prompted, enter the following username and password:

Username: ".$user->Name.“
Password: “.$pass.”
”;
}
}

How can I add this user to a group automatically in this script?

Thanks,
Andreas