1 # Initial data for a fresh RT3 Installation.
5 RealName => 'Nobody in particular',
6 Comments => 'Do not delete or modify this user. It is integral '
7 . 'to RT\'s internal data structures',
12 RealName => 'Enoch Root',
13 Password => 'password',
14 EmailAddress => "root\@localhost",
15 Comments => 'SuperUser',
16 Privileged => '1', } );
20 Type => 'Everyone', # loc
21 Domain => 'SystemInternal',
23 Description => 'Pseudogroup for internal use', # loc
25 { Type => 'Privileged', # loc
26 Domain => 'SystemInternal',
29 Description => 'Pseudogroup for internal use', # loc
32 Type => 'Unprivileged', # loc
33 Domain => 'SystemInternal',
35 Description => 'Pseudogroup for internal use', # loc
38 Type => 'Owner', # loc
39 Domain => 'RT::System-Role',
41 Description => 'SystemRolegroup for internal use', # loc
44 Type => 'Requestor', # loc
45 Domain => 'RT::System-Role',
47 Description => 'SystemRolegroup for internal use', # loc
51 Domain => 'RT::System-Role',
53 Description => 'SystemRolegroup for internal use', # loc
56 Type => 'AdminCc', # loc
57 Domain => 'RT::System-Role',
59 Description => 'Pseudogroup for internal use', # loc
62 @Queues = ({ Name => 'General',
63 Description => 'The default queue',
64 CorrespondAddress => "",
65 CommentAddress => "", },
66 { Name => '___Approvals',
67 Description => 'A system-internal queue for the approvals system',
72 { Name => 'Autoreply To Requestors', # loc
74 'Always sends a message to the requestors independent of message sender' , # loc
75 ExecModule => 'Autoreply',
76 Argument => 'Requestor' },
77 { Name => 'Notify Requestors', # loc
78 Description => 'Sends a message to the requestors', # loc
79 ExecModule => 'Notify',
80 Argument => 'Requestor' },
81 { Name => 'Notify Owner as Comment', # loc
82 Description => 'Sends mail to the owner', # loc
83 ExecModule => 'NotifyAsComment',
84 Argument => 'Owner' },
85 { Name => 'Notify Owner', # loc
86 Description => 'Sends mail to the owner', # loc
87 ExecModule => 'Notify',
88 Argument => 'Owner' },
89 { Name => 'Notify AdminCcs as Comment', # loc
90 Description => 'Sends mail to the administrative Ccs as a comment', # loc
91 ExecModule => 'NotifyAsComment',
92 Argument => 'AdminCc' },
93 { Name => 'Notify AdminCcs', # loc
94 Description => 'Sends mail to the administrative Ccs', # loc
95 ExecModule => 'Notify',
96 Argument => 'AdminCc' },
98 { Name => 'Notify Requestors and Ccs as Comment', # loc
99 Description => 'Send mail to requestors and Ccs as a comment', # loc
100 ExecModule => 'NotifyAsComment',
101 Argument => 'Requestor,Cc' },
103 { Name => 'Notify Requestors and Ccs', # loc
104 Description => 'Send mail to requestors and Ccs', # loc
105 ExecModule => 'Notify',
106 Argument => 'Requestor,Cc' },
108 { Name => 'Notify Requestors, Ccs and AdminCcs as Comment', # loc
109 Description => 'Send mail to all watchers as a "comment"', # loc
110 ExecModule => 'NotifyAsComment',
112 { Name => 'Notify Requestors, Ccs and AdminCcs', # loc
113 Description => 'Send mail to all watchers', # loc
114 ExecModule => 'Notify',
116 { Name => 'Notify Other Recipients as Comment', # loc
117 Description => 'Sends mail to explicitly listed Ccs and Bccs', # loc
118 ExecModule => 'NotifyAsComment',
119 Argument => 'OtherRecipients' },
120 { Name => 'Notify Other Recipients', # loc
121 Description => 'Sends mail to explicitly listed Ccs and Bccs', # loc
122 ExecModule => 'Notify',
123 Argument => 'OtherRecipients' },
124 { Name => 'User Defined', # loc
125 Description => 'Perform a user-defined action', # loc
126 ExecModule => 'UserDefined', },
127 { Name => 'Create Tickets', # loc
129 'Create new tickets based on this scrip\'s template', # loc
130 ExecModule => 'CreateTickets', },
131 { Name => 'Open Tickets',
132 Description => 'Open tickets on correspondence', # loc
133 ExecModule => 'AutoOpen' },
137 { Name => 'On Create', # loc
138 Description => 'When a ticket is created', # loc
139 ApplicableTransTypes => 'Create',
140 ExecModule => 'AnyTransaction', },
142 { Name => 'On Transaction', # loc
143 Description => 'When anything happens', # loc
144 ApplicableTransTypes => 'Any',
145 ExecModule => 'AnyTransaction', },
148 Name => 'On Correspond', # loc
149 Description => 'Whenever correspondence comes in', # loc
150 ApplicableTransTypes => 'Correspond',
151 ExecModule => 'AnyTransaction', },
155 Name => 'On Comment', # loc
156 Description => 'Whenever comments come in', # loc
157 ApplicableTransTypes => 'Comment',
158 ExecModule => 'AnyTransaction' },
161 Name => 'On Status Change', # loc
162 Description => 'Whenever a ticket\'s status changes', # loc
163 ApplicableTransTypes => 'Status',
164 ExecModule => 'AnyTransaction',
169 Name => 'On Owner Change', # loc
170 Description => 'Whenever a ticket\'s owner changes', # loc
171 ApplicableTransTypes => 'Any',
172 ExecModule => 'OwnerChange',
177 Name => 'On Queue Change', # loc
178 Description => 'Whenever a ticket\'s queue changes', # loc
179 ApplicableTransTypes => 'Set',
180 ExecModule => 'QueueChange',
183 { Name => 'On Resolve', # loc
184 Description => 'Whenever a ticket is resolved', # loc
185 ApplicableTransTypes => 'Status',
186 ExecModule => 'StatusChange',
187 Argument => 'resolved'
191 { Name => 'User Defined', # loc
192 Description => 'Whenever a user-defined condition occurs', # loc
193 ApplicableTransTypes => 'Any',
194 ExecModule => 'UserDefined'
202 Name => 'Blank', # loc
203 Description => 'A blank template', # loc
206 Name => 'Autoreply', # loc
207 Description => 'Default Autoresponse template', # loc
208 Content => 'Subject: AutoReply: {$Ticket->Subject}
213 This message has been automatically generated in response to the
214 creation of a trouble ticket regarding:
215 "{$Ticket->Subject()}",
216 a summary of which appears below.
218 There is no need to reply to this message right now. Your ticket has been
219 assigned an ID of [{$rtname} #{$Ticket->id()}].
221 Please include the string:
223 [{$rtname} #{$Ticket->id}]
225 in the subject line of all future correspondence about this issue. To do so,
226 you may reply to this message.
229 {$Ticket->QueueObj->CorrespondAddress()}
231 -------------------------------------------------------------------------
232 {$Transaction->Content()}
237 Name => 'Transaction', # loc
238 Description => 'Default transaction template', # loc
239 Content => 'RT-Attach-Message: yes
242 {$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
243 Transaction: {$Transaction->Description}
244 Queue: {$Ticket->QueueObj->Name}
245 Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
246 Owner: {$Ticket->OwnerObj->Name}
247 Requestors: {$Ticket->RequestorAddresses}
248 Status: {$Ticket->Status}
249 Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
252 {$Transaction->Content()}
259 Name => 'Admin Correspondence', # loc
260 Description => 'Default admin correspondence template', # loc
261 Content => 'RT-Attach-Message: yes
264 <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
266 {$Transaction->Content()}
271 Name => 'Correspondence', # loc
272 Description => 'Default correspondence template', # loc
273 Content => 'RT-Attach-Message: yes
275 {$Transaction->Content()}
280 Name => 'Admin Comment', # loc
281 Description => 'Default admin comment template', # loc
283 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\\[Comment\\]//g; $comment =~ s/^Re//i; $s;}
286 {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
287 This is a comment. It is not sent to the Requestor(s):
289 {$Transaction->Content()}
294 Name => 'Status Change', # loc
295 Description => 'Ticket status changed', # loc
296 Content => 'Subject: Status Changed to: {$Transaction->NewValue}
299 {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
301 {$Transaction->Content()}
308 Name => 'Resolved', # loc
309 Description => 'Ticket Resolved', # loc
310 Content => 'Subject: Ticket Resolved
312 According to our records, your request has been resolved. If you have any
313 further questions or concerns, please respond to this message.
316 { Queue => '___Approvals',
317 Name => "New Pending Approval", # loc
319 "Notify Owners and AdminCcs of new items pending their approval", # loc
320 Content => 'Subject: New Pending Approval: {$Ticket->Subject}
324 There is a new item pending your approval: "{$Ticket->Subject()}",
325 a summary of which appears below.
327 Please visit {$RT::WebURL}Approvals/Display.html?id={$Ticket->id}
328 to approve or reject this ticket, or {$RT::WebURL}Approvals/ to
329 batch-process all your pending approvals.
331 -------------------------------------------------------------------------
332 {$Transaction->Content()}
335 { Queue => '___Approvals',
336 Name => "Approval Passed", # loc
338 "Notify Owner of their ticket has been approved by some approver", # loc
339 Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
343 Your ticket has been approved by { eval { $Approval->OwnerObj->Name } }.
344 Other approvals may be pending.
347 { Queue => '___Approvals',
348 Name => "All Approvals Passed", # loc
350 "Notify Owner of their ticket has been approved by all approvers", # loc
351 Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
355 Your ticket has been approved. Its Owner may now start to act on it.
358 { Queue => '___Approvals',
359 Name => "Approval Rejected", # loc
361 "Notify Owner of their rejected ticket", # loc
362 Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
366 Your ticket has been rejected by { eval { $Approval->OwnerObj->Name } }.
373 { ScripCondition => 'On Correspond',
374 ScripAction => 'Open Tickets',
375 Template => 'Blank' },
376 { ScripCondition => 'On Create',
377 ScripAction => 'AutoReply To Requestors',
378 Template => 'AutoReply' },
379 { ScripCondition => 'On Create',
380 ScripAction => 'Notify AdminCcs',
381 Template => 'Transaction' },
382 { ScripCondition => 'On Correspond',
383 ScripAction => 'Notify AdminCcs',
384 Template => 'Admin Correspondence' },
385 { ScripCondition => 'On Correspond',
386 ScripAction => 'Notify Requestors And Ccs',
387 Template => 'Correspondence' },
388 { ScripCondition => 'On Correspond',
389 ScripAction => 'Notify Other Recipients',
390 Template => 'Correspondence' },
391 { ScripCondition => 'On Comment',
392 ScripAction => 'Notify AdminCcs As Comment',
393 Template => 'Admin Comment' },
394 { ScripCondition => 'On Comment',
395 ScripAction => 'Notify Other Recipients As Comment',
396 Template => 'Correspondence' },
397 { ScripCondition => 'On Resolve',
398 ScripAction => 'Notify Requestors',
399 Template => 'Resolved' },
400 { Description => "When an approval ticket is created, notify the Owner and AdminCc of the item awaiting their approval", # loc
401 Queue => '___Approvals',
402 ScripCondition => 'User Defined',
403 CustomIsApplicableCode => q[
404 $self->TicketObj->Type eq 'approval' and
405 $self->TransactionObj->Field eq 'Status' and
406 $self->TransactionObj->NewValue eq 'open' and
407 eval { $T::Approving = ($self->TicketObj->AllDependedOnBy( Type => 'ticket' ))[0] }
409 ScripAction => 'Notify Owner',
410 Template => 'New Pending Approval' },
411 { Description => "If an approval is rejected, reject the original and delete pending approvals", # loc
412 Queue => '___Approvals',
413 ScripCondition => 'On Status Change',
414 ScripAction => 'User Defined',
415 CustomPrepareCode => q[
416 # ------------------------------------------------------------------- #
417 return(0) unless ( lc($self->TransactionObj->NewValue) eq "rejected" or
418 lc($self->TransactionObj->NewValue) eq "deleted" );
421 my $links = $self->TicketObj->DependedOnBy;
422 foreach my $link (@{ $links->ItemsArrayRef }) {
423 my $obj = $link->BaseObj;
424 if ($obj->QueueObj->IsActiveStatus($obj->Status)) {
425 if ($obj->Type eq 'ticket') {
427 Content => $self->loc("Your request was rejected."),
430 Status => 'rejected',
434 $T::Approval = $self->TicketObj; # so we can access it inside templates
435 $self->{TicketObj} = $obj; # we want the original id in the token line
447 $links = $self->TicketObj->DependsOn;
448 foreach my $link (@{ $links->ItemsArrayRef }) {
449 my $obj = $link->TargetObj;
450 if ($obj->QueueObj->IsActiveStatus($obj->Status)) {
458 # Now magically turn myself into a Requestor Notify object...
459 require RT::Action::Notify; bless($self, 'RT::Action::Notify');
460 $self->{Argument} = 'Requestor'; $self->Prepare;
463 # ------------------------------------------------------------------- #
465 CustomCommitCode => '"never needed"',
466 Template => 'Approval Rejected', },
467 { Description => "When a ticket has been approved by any approver, add correspondence to the original ticket", # loc
468 Queue => '___Approvals',
469 ScripCondition => 'On Resolve',
470 ScripAction => 'User Defined',
471 CustomPrepareCode => q[
472 # ------------------------------------------------------------------- #
473 return(0) unless ($self->TicketObj->Type eq 'approval');
476 my $t = $self->TicketObj->Transactions;
477 while (my $o = $t->Next) {
478 $note .= $o->Content . "\n" if $o->ContentObj
479 and $o->Content !~ /Default Approval/;
482 foreach my $obj ($self->TicketObj->AllDependedOnBy( Type => 'ticket' )) {
484 Content => $self->loc( "Your request has been approved by [_1]. Other approvals may still be pending.", # loc
485 $self->TransactionObj->CreatorObj->Name,
486 ) . "\n" . $self->loc( "Approver's notes: [_1]", # loc
490 $T::Approval = $self->TicketObj; # so we can access it inside templates
491 $self->{TicketObj} = $obj; # we want the original id in the token line
494 # Now magically turn myself into a Requestor Notify object...
495 require RT::Action::Notify; bless($self, 'RT::Action::Notify');
496 $self->{Argument} = 'Requestor'; $self->Prepare;
499 # ------------------------------------------------------------------- #
501 CustomCommitCode => '"never needed"',
502 Template => 'Approval Passed' },
503 { Description => "When a ticket has been approved by all approvers, add correspondence to the original ticket", # loc
504 Queue => '___Approvals',
505 ScripCondition => 'On Resolve',
506 ScripAction => 'User Defined',
507 CustomPrepareCode => q[
508 # ------------------------------------------------------------------- #
509 # Find all the tickets that depend on this (that this is approving)
511 my $Ticket = $self->TicketObj;
512 my @TOP = $Ticket->AllDependedOnBy( Type => 'ticket' );
513 my $links = $Ticket->DependedOnBy;
516 while (my $link = $links->Next) {
517 my $obj = $link->BaseObj;
518 next if ($obj->HasUnresolvedDependencies( Type => 'approval' ));
520 if ($obj->Type eq 'ticket') {
522 Content => $self->loc("Your request has been approved."),
524 $T::Approval = $Ticket; # so we can access it inside templates
525 $self->{TicketObj} = $obj; # we want the original id in the token line
528 elsif ($obj->Type eq 'approval') {
529 $obj->SetStatus( Status => 'open', Force => 1 );
531 elsif ($RT::UseCodeTickets and $obj->Type eq 'code') {
532 my $code = $obj->Transactions->First->Content;
535 foreach my $TOP (@TOP) {
538 $RT::Logger->error("Cannot eval code: $@") if $@;
542 $obj->SetStatus( Status => 'resolved', Force => 1,);
545 $obj->SetStatus( Status => 'rejected', Force => 1,);
550 # Now magically turn myself into a Requestor Notify object...
551 require RT::Action::Notify; bless($self, 'RT::Action::Notify');
552 $self->{Argument} = 'Requestor'; $self->Prepare;
555 # ------------------------------------------------------------------- #
557 CustomCommitCode => '"never needed"',
558 Template => 'All Approvals Passed', },
563 { UserId => 'Nobody', # - principalId
564 Right => 'OwnTicket', },
566 { UserId => 'root', # - principalid
567 Right => 'SuperUser', },