[rt-users] Create multiple tickets from a template
Kevin Squire
gentgeen at linuxmail.org
Thu Jun 14 21:05:50 EDT 2007
On Thu, 14 Jun 2007 16:12:01 -0500
"Schincke, Keith D. (JSC-IT)[MEI]" <Keith.D.Schincke at nasa.gov> wrote:
> The Wiki description was great. It allowed the creation of the
> approval
> process where one person or any person in a group could approve a
> ticket.
>
> What I need is a way to call the template for each member of the group
> with the result of creating a ticket for each member that must be
> approved before the parent ticket can start.
>
> Keith Schincke
>
I had a similar case. I don't think what I am about to show will
completely solve your issue, but might help to point you in the right
direction.
Our scenario was 1st approval was by any member of the HR dept. the
second approval had to come from the requesters supervisor. The
requester had to input his/her supervisor in a customfield (pick one).
I used the supervisors RT username in the custom field options.
Ticket two was not visible to the supervisor until Ticket One was
approved, even though both Ticket One and Ticket Two were both created
when the user submitted the request.
I image you can use the AdminCC part on the first ticket for your
groups (I got that from the wiki) Then create as many tickets as you
need to just by adding "===Create-Ticket: " sections to your template.
just remember to add the "Depends-On: <TICKET ABOVE>" part to each
of your sections.
The template was:
===Create-Ticket: hr-approval
Subject: Approval of { $Tickets{'TOP'}->Subject() }
Depended-On-By: TOP
Queue: TimeOff-Approval
Type: approval
Owner:
AdminCC: {
my $group_name = 'human_resources';
my $groups = RT::Groups->new( $RT::SystemUser );
$groups->LimitToUserDefinedGroups();
$groups->Limit(
'FIELD' => 'Name',
'OPERATOR' => '=',
'VALUE' => $group_name );
$groups->First->Id;
}
Content:
ENDOFCONTENT
===Create-Ticket: super-approval
Subject: Approval of { $Tickets{'TOP'}->Subject() }
Depended-On-By: TOP
Depends-On: hr-approval
Queue: TimeOff-Approval
Type: approval
{ my $owner = $Tickets{'TOP'}->FirstCustomFieldValue('Supervisor');
my $OUTPUT = "Owner: $owner";
$OUTPUT;
}
Content:
ENDOFCONTENT
--
http://gentgeen.homelinux.org
#############################################################
Associate yourself with men of good quality if you esteem
your own reputation; for 'tis better to be alone then in bad
company. - George Washington, Rules of Civility
More information about the rt-users
mailing list