Sorry to bother you again.
Keep all replies on-list. I do not have time to reply to every email,
and replying to me directly means that (a) others do not have the
opportunity to respond, and (b) denies answers to current and future
readers of the list.
If you need commercial support, which does get you a direct, reliable
line to the BPS engineers for complete answers, I can put you in touch
with our sales side.
I have tried using the code because it seems like it is what i’m
looking for, however, the tickets do not come up as “pending approval”
anymore, they are coming up as “new”.
“Pending Approval” is not a status; “new” is. You’ll need to be more
specific.
This is what I am using:
===Create-Ticket: approval
{ # Find out who the administrators of the group called “HR”
of which the creator of this ticket is a member
my $name = "DL_IT_Request_Tracker_Admins";
my $groups = RT::Groups->new(RT->SystemUser);
$groups->LimitToUserDefinedGroups();
$groups->Limit(FIELD => "Name", OPERATOR => "=", VALUE => "$name");
$groups->WithMember($TransactionObj->CreatorObj->Id);
my $groupid = $groups->First->Id;
This finds you a group named “DL_IT_Request_Tracker_Admins” which the
triggering user is a member of. I’m skeptical that the latter half of
the phrase is what you want; I expect you want:
my $group = RT::Group->new(RT->SystemUser);
$group->LoadUserDefinedGroup( "DL_IT_Request_Tracker_Admins" );
my $adminccs = RT::Users->new(RT->SystemUser);
$adminccs->WhoHaveRight(
Right => "AdminGroup",
Object =>$groups->First,
IncludeSystemRights => undef,
IncludeSuperusers => 0,
IncludeSubgroupMembers => 0,
);
This finds people who have the ability to add and remove users from the
aforementioned group. I see no reason that this is what you want.
my @admins;
while (my $admin = $adminccs->Next) {
push (@admins, $admin->EmailAddress);
}
This is unnecessary; see below.
}
Queue: ___Approvals
Type: approval
AdminCc: {join ("\nAdminCc: ",@admins) }
Use:
AdminCc: { $group->MemberEmailAddressesAsString }
Depended-On-By: TOP
Refers-To: TOP
Subject: Approval for ticket: {$Tickets{“TOP”}->Id} - {$Tickets{“TOP”}->Subject}
Due: {time + 86400}
Content-Type: text/plain
Content: Your approval is requested for the ticket {$Tickets{“TOP”}->Id}: {$Tickets{“TOP”}->Subject}
Blah
Blah
ENDOFCONTENT
===Create-Ticket: two
Subject: Manager approval
Type: approval
Depended-On-By: TOP
Refers-To: {$Tickets{“create-approval”}->Id}
Queue: ___Approvals
Content-Type: text/plain
Content:
Your approval is required for this ticket, too.
ENDOFCONTENT
This second approval has no owner or admincc.