1 # Initial data for a fresh RT installation.
6 RealName => 'Enoch Root',
7 Password => 'password',
8 EmailAddress => "root\@localhost",
9 Comments => 'SuperUser',
17 @Queues = ({ Name => 'General',
18 Description => 'The default queue',
19 CorrespondAddress => "",
20 CommentAddress => "", },
21 { Name => '___Approvals',
22 Lifecycle => 'approvals',
23 Description => 'A system-internal queue for the approvals system',
28 { Name => 'Autoreply To Requestors', # loc
30 'Always sends a message to the requestors independent of message sender' , # loc
31 ExecModule => 'Autoreply',
32 Argument => 'Requestor' },
33 { Name => 'Notify Requestors', # loc
34 Description => 'Sends a message to the requestors', # loc
35 ExecModule => 'Notify',
36 Argument => 'Requestor' },
37 { Name => 'Notify Owner as Comment', # loc
38 Description => 'Sends mail to the owner', # loc
39 ExecModule => 'NotifyAsComment',
40 Argument => 'Owner' },
41 { Name => 'Notify Owner', # loc
42 Description => 'Sends mail to the owner', # loc
43 ExecModule => 'Notify',
44 Argument => 'Owner' },
45 { Name => 'Notify Ccs as Comment', # loc
46 Description => 'Sends mail to the Ccs as a comment', # loc
47 ExecModule => 'NotifyAsComment',
49 { Name => 'Notify Ccs', # loc
50 Description => 'Sends mail to the Ccs', # loc
51 ExecModule => 'Notify',
53 { Name => 'Notify AdminCcs as Comment', # loc
54 Description => 'Sends mail to the administrative Ccs as a comment', # loc
55 ExecModule => 'NotifyAsComment',
56 Argument => 'AdminCc' },
57 { Name => 'Notify AdminCcs', # loc
58 Description => 'Sends mail to the administrative Ccs', # loc
59 ExecModule => 'Notify',
60 Argument => 'AdminCc' },
62 { Name => 'Notify Requestors and Ccs as Comment', # loc
63 Description => 'Send mail to requestors and Ccs as a comment', # loc
64 ExecModule => 'NotifyAsComment',
65 Argument => 'Requestor,Cc' },
68 # { Name => 'Notify Requestors and Ccs', # loc
69 # Description => 'Send mail to requestors and Ccs', # loc
70 # ExecModule => 'Notify',
71 # Argument => 'Requestor,Cc' },
74 { Name => 'Notify Owner, Requestors, Ccs and AdminCcs as Comment', # loc
75 Description => 'Send mail to owner and all watchers as a "comment"', # loc
76 ExecModule => 'NotifyAsComment',
78 { Name => 'Notify Owner, Requestors, Ccs and AdminCcs', # loc
79 Description => 'Send mail to owner and all watchers', # loc
80 ExecModule => 'Notify',
82 { Name => 'Notify Other Recipients as Comment', # loc
83 Description => 'Sends mail to explicitly listed Ccs and Bccs', # loc
84 ExecModule => 'NotifyAsComment',
85 Argument => 'OtherRecipients' },
87 # { Name => 'Notify Other Recipients', # loc
88 # Description => 'Sends mail to explicitly listed Ccs and Bccs', # loc
89 # ExecModule => 'Notify',
90 # Argument => 'OtherRecipients' },
92 { Name => 'User Defined', # loc
93 Description => 'Perform a user-defined action', # loc
94 ExecModule => 'UserDefined', },
95 { Name => 'Create Tickets', # loc
97 'Create new tickets based on this scrip\'s template', # loc
98 ExecModule => 'CreateTickets', },
99 { Name => 'Open Tickets', # loc
100 Description => 'Open tickets on correspondence', # loc
101 ExecModule => 'AutoOpen' },
102 { Name => 'Extract Subject Tag', # loc
103 Description => 'Extract tags from a Transaction\'s subject and add them to the Ticket\'s subject.', # loc
104 ExecModule => 'ExtractSubjectTag' },
107 { Name => 'Set Priority',
108 Description => 'Set ticket priority',
109 ExecModule => 'SetPriority',
112 { Name => 'Cancel Scheduled Resolve',
113 Description => 'Set ticket not to resolve in the future',
114 ExecModule => 'SetWillResolve',
117 { Name => 'Scheduled Resolve',
118 Description => 'Resolve ticket if its WillResolve date has passed',
119 ExecModule => 'ScheduledResolve',
122 # combine these into a single action so they can see each other in the headers
123 { Name => 'Notify Requestors, Ccs, and Other Recipients',
124 Description => 'Send mail to requestors, watchers, and explicit Ccs',
125 ExecModule => 'Notify',
126 Argument => 'Requestor,Cc,OtherRecipients',
131 { Name => 'On Create', # loc
132 Description => 'When a ticket is created', # loc
133 ApplicableTransTypes => 'Create',
134 ExecModule => 'AnyTransaction', },
136 { Name => 'On Transaction', # loc
137 Description => 'When anything happens', # loc
138 ApplicableTransTypes => 'Any',
139 ExecModule => 'AnyTransaction', },
142 Name => 'On Correspond', # loc
143 Description => 'Whenever correspondence comes in', # loc
144 ApplicableTransTypes => 'Correspond',
145 ExecModule => 'AnyTransaction', },
149 Name => 'On Forward', # loc
150 Description => 'Whenever a ticket or transaction is forwarded', # loc
151 ApplicableTransTypes => 'Forward Transaction,Forward Ticket',
152 ExecModule => 'AnyTransaction', },
156 Name => 'On Forward Ticket', # loc
157 Description => 'Whenever a ticket is forwarded', # loc
158 ApplicableTransTypes => 'Forward Ticket',
159 ExecModule => 'AnyTransaction', },
163 Name => 'On Forward Transaction', # loc
164 Description => 'Whenever a transaction is forwarded', # loc
165 ApplicableTransTypes => 'Forward Transaction',
166 ExecModule => 'AnyTransaction', },
170 Name => 'On Comment', # loc
171 Description => 'Whenever comments come in', # loc
172 ApplicableTransTypes => 'Comment',
173 ExecModule => 'AnyTransaction' },
176 Name => 'On Status Change', # loc
177 Description => 'Whenever a ticket\'s status changes', # loc
178 ApplicableTransTypes => 'Status',
179 ExecModule => 'AnyTransaction',
184 Name => 'On Priority Change', # loc
185 Description => 'Whenever a ticket\'s priority changes', # loc
186 ApplicableTransTypes => 'Set',
187 ExecModule => 'PriorityChange',
191 Name => 'On Owner Change', # loc
192 Description => 'Whenever a ticket\'s owner changes', # loc
193 ApplicableTransTypes => 'Any',
194 ExecModule => 'OwnerChange',
199 Name => 'On Queue Change', # loc
200 Description => 'Whenever a ticket\'s queue changes', # loc
201 ApplicableTransTypes => 'Set',
202 ExecModule => 'QueueChange',
205 { Name => 'On Resolve', # loc
206 Description => 'Whenever a ticket is resolved', # loc
207 ApplicableTransTypes => 'Status',
208 ExecModule => 'StatusChange',
209 Argument => 'resolved'
212 { Name => 'On Reject', # loc
213 Description => 'Whenever a ticket is rejected', # loc
214 ApplicableTransTypes => 'Status',
215 ExecModule => 'StatusChange',
216 Argument => 'rejected'
219 { Name => 'User Defined', # loc
220 Description => 'Whenever a user-defined condition occurs', # loc
221 ApplicableTransTypes => 'Any',
222 ExecModule => 'UserDefined'
226 { Name => 'On Close', # loc
227 Description => 'Whenever a ticket is closed', # loc
228 ApplicableTransTypes => 'Status,Set',
229 ExecModule => 'CloseTicket',
231 { Name => 'On Reopen', # loc
232 Description => 'Whenever a ticket is reopened', # loc
233 ApplicableTransTypes => 'Status,Set',
234 ExecModule => 'ReopenTicket',
238 { Name => 'On Custom Field Transaction',
239 Description => 'When a custom field is changed',
240 ExecModule => 'CustomFieldTransaction',
241 ApplicableTransTypes => 'Any',
243 { Name => 'On Custom Field Change',
244 Description => 'When a custom field is changed to some value',
245 ExecModule => 'CustomFieldChange',
246 ApplicableTransTypes => 'Any',
253 Name => 'Blank', # loc
254 Description => 'A blank template', # loc
257 Name => 'Autoreply', # loc
258 Description => 'Default Autoresponse template', # loc
259 Content => 'Subject: AutoReply: {$Ticket->Subject}
264 This message has been automatically generated in response to the
265 creation of a trouble ticket regarding:
266 "{$Ticket->Subject()}",
267 a summary of which appears below.
269 There is no need to reply to this message right now. Your ticket has been
270 assigned an ID of { $Ticket->SubjectTag }.
272 Please include the string:
274 { $Ticket->SubjectTag }
276 in the subject line of all future correspondence about this issue. To do so,
277 you may reply to this message.
280 {$Ticket->QueueObj->CorrespondAddress()}
282 -------------------------------------------------------------------------
283 {$Transaction->Content()}
288 Name => 'AutoreplyOrCorrespondence', # loc
289 Description => 'Plaintext AutoreplyOrCorrespondence template', # loc
292 my $creator_name = $Ticket->CreatorObj->Name;
293 my $requestors = $Ticket->Requestors->UserMembersObj;
294 my ( $c_requestor, $r_count ) = ( 0, 0 );
295 while ( my $r = $requestors->Next() ) {
296 if ( $r->Name eq $creator_name ) {
303 my $template = new RT::Template($RT::SystemUser);
306 #if the creator is not a requestor or
307 #there is more than one requestor ( who's not the creator )
308 #use the Correspondence template
309 if ( ! $c_requestor || $r_count ) {
310 $template_name = 'Correspondence';
313 #otherwise use the Autoreply template
314 $template_name = 'Autoreply';
317 #Load the Queue Template
318 $template->LoadQueueTemplate(
319 Queue => $Ticket->Queue,
320 Name => $template_name,
322 #if there's no Queue Template attempt to find a Global one.
323 unless ( $template->id ) {
324 $template->LoadGlobalTemplate( $template_name );
325 unless ( $template->id ) {
326 $RT::Logger->error("Could not load template : $template_name")
329 #Process embedded fields & expressions of true templates;
330 #note that we can only meaningfully use the body
331 my($ret, $msg) = $template->Parse(
332 TicketObj => $Ticket,
333 TransactionObj => $Transaction,
335 $ret ? $template->MIMEObj->stringify : $msg;
340 Name => 'AutoreplyOrCorrespondence in HTML', # loc
341 Description => 'HTML AutoreplyOrCorrespondence template', # loc
344 my $creator_name = $Ticket->CreatorObj->Name;
345 my $requestors = $Ticket->Requestors->UserMembersObj;
346 my ( $c_requestor, $r_count ) = ( 0, 0 );
347 while ( my $r = $requestors->Next() ) {
348 if ( $r->Name eq $creator_name ) {
355 my $template = new RT::Template($RT::SystemUser);
358 #if the creator is not a requestor or
359 #there is more than one requestor ( who's not the creator )
360 #use the Correspondence template
361 if ( ! $c_requestor || $r_count ) {
362 $template_name = 'Correspondence in HTML';
365 #otherwise use the Autoreply in HTML template
366 $template_name = 'Autoreply in HTML';
369 #Load the Queue Template
370 $template->LoadQueueTemplate(
371 Queue => $Ticket->Queue,
372 Name => $template_name,
374 #if there's no Queue Template attempt to find a Global one.
375 unless ( $template->id ) {
376 $template->LoadGlobalTemplate( $template_name );
377 unless ( $template->id ) {
378 $RT::Logger->error("Could not load template : $template_name")
381 #Process embedded fields & expressions of true templates;
382 #note that we can only meaningfully use the body
383 my($ret, $msg) = $template->Parse(
384 TicketObj => $Ticket,
385 TransactionObj => $Transaction,
387 $ret ? $template->MIMEObj->stringify : $msg;
392 Name => 'Transaction', # loc
393 Description => 'Default transaction template', # loc
394 Content => 'RT-Attach-Message: yes
397 {$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
398 Transaction: {$Transaction->Description}
399 Queue: {$Ticket->QueueObj->Name}
400 Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
401 Owner: {$Ticket->OwnerObj->Name}
402 Requestors: {$Ticket->RequestorAddresses}
403 Status: {$Ticket->Status}
404 Ticket <URL: {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id} >
407 {$Transaction->Content()}
414 Name => 'Admin Correspondence', # loc
415 Description => 'Default admin correspondence template', # loc
416 Content => 'RT-Attach-Message: yes
419 <URL: {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id} >
421 {$Transaction->Content()}
426 Name => 'Correspondence', # loc
427 Description => 'Default correspondence template', # loc
428 Content => 'RT-Attach-Message: yes
430 {$Transaction->Content()}
435 Name => 'Admin Comment', # loc
436 Description => 'Default admin comment template', # loc
438 'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject||""); $s =~ s/\\[Comment\\]\\s*//g; $s =~ s/^Re:\\s*//i; $s;}
439 RT-Attach-Message: yes
442 {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
443 This is a comment. It is not sent to the Requestor(s):
445 {$Transaction->Content()}
450 Name => 'Status Change', # loc
451 Description => 'Ticket status changed', # loc
452 Content => 'Subject: Status Changed to: {$Transaction->NewValue}
455 {RT->Config->Get(\'WebURL\')}Ticket/Display.html?id={$Ticket->id}
457 {$Transaction->Content()}
464 Name => 'Resolved', # loc
465 Description => 'Ticket Resolved', # loc
466 Content => 'Subject: Resolved: {$Ticket->Subject}
468 According to our records, your request has been resolved. If you have any
469 further questions or concerns, please respond to this message.
472 { Queue => '___Approvals',
473 Name => "New Pending Approval", # loc
475 "Notify Owners and AdminCcs of new items pending their approval", # loc
476 Content => 'Subject: New Pending Approval: {$Ticket->Subject}
480 There is a new item pending your approval: "{$Ticket->Subject()}",
481 a summary of which appears below.
483 Please visit {RT->Config->Get(\'WebURL\')}Approvals/Display.html?id={$Ticket->id}
484 to approve or reject this ticket, or {RT->Config->Get(\'WebURL\')}Approvals/ to
485 batch-process all your pending approvals.
487 -------------------------------------------------------------------------
488 {$Transaction->Content()}
491 { Queue => '___Approvals',
492 Name => "Approval Passed", # loc
494 "Notify Requestor of their ticket has been approved by some approver", # loc
495 Content => 'Subject: Ticket Approved: {$Ticket->Subject}
499 Your ticket has been approved by { eval { $Approver->Name } }.
500 Other approvals may be pending.
502 Approver\'s notes: { $Notes }
505 { Queue => '___Approvals',
506 Name => "All Approvals Passed", # loc
508 "Notify Requestor of their ticket has been approved by all approvers", # loc
509 Content => 'Subject: Ticket Approved: {$Ticket->Subject}
513 Your ticket has been approved by { eval { $Approver->Name } }.
514 Its Owner may now start to act on it.
516 Approver\'s notes: { $Notes }
519 { Queue => '___Approvals',
520 Name => "Approval Rejected", # loc
522 "Notify Owner of their rejected ticket", # loc
523 Content => 'Subject: Ticket Rejected: {$Ticket->Subject}
527 Your ticket has been rejected by { eval { $Approver->Name } }.
529 Approver\'s notes: { $Notes }
532 { Queue => '___Approvals',
533 Name => "Approval Ready for Owner", # loc
535 "Notify Owner of their ticket has been approved and is ready to be acted on", # loc
536 Content => 'Subject: Ticket Approved: {$Ticket->Subject}
540 The ticket has been approved, you may now start to act on it.
545 Name => "Forward", # loc
546 Description => "Heading of a forwarded message", # loc
548 This is a forward of transaction #{$Transaction->id} of ticket #{ $Ticket->id }
552 Name => "Forward Ticket", # loc
553 Description => "Heading of a forwarded Ticket", # loc
556 This is a forward of ticket #{ $Ticket->id }
560 Name => "Error: public key", # loc
562 "Inform user that he has problems with public key and couldn't recieve encrypted content", # loc
563 Content => q{Subject: We have no your public key or it's wrong
565 You received this message as we have no your public PGP key or we have a problem with your key. Inform the administrator about the problem.
569 Name => "Error to RT owner: public key", # loc
571 "Inform RT owner that user(s) have problems with public keys", # loc
572 Content => q{Subject: Some users have problems with public keys
574 You received this message as RT has problems with public keys of the following user:
576 foreach my $e ( @BadRecipients ) {
577 $OUT .= "* ". $e->{'Message'} ."\n";
582 Name => "Error: no private key", # loc
584 "Inform user that we received an encrypted email and we have no private keys to decrypt", # loc
585 Content => q{Subject: we received message we cannot decrypt
587 You sent an encrypted message with subject '{ $Message->head->get('Subject') }',
588 but we have no private key it's encrypted to.
590 Please, check that you encrypt messages with correct keys
591 or contact the system administrator.}
594 Name => "Error: bad GnuPG data", # loc
596 "Inform user that a message he sent has invalid GnuPG data", # loc
597 Content => q{Subject: We received a message we cannot handle
599 You sent us a message that we cannot handle due to corrupted GnuPG signature or encrypted block. we get the following error(s):
600 { foreach my $msg ( @Messages ) {
606 Name => "PasswordChange", # loc
608 "Inform user that his password has been reset", # loc
609 Content => q{Subject: [{RT->Config->Get('rtname')}] Password reset
613 Someone at {$ENV{'REMOTE_ADDR'}} requested a password reset for you on {RT->Config->Get('WebURL')}
615 Your new password is:
621 Name => 'Email Digest', # loc
622 Description => 'Email template for periodic notification digests', # loc
623 Content => q[Subject: RT Email Digest
631 Name => "Error: Missing dashboard", # loc
633 "Inform user that a dashboard he subscribed to is missing", # loc
634 Content => q{Subject: [{RT->Config->Get('rtname')}] Missing dashboard!
638 You are subscribed to a dashboard that is currently missing. Most likely, the dashboard was deleted.
640 RT will remove this subscription as it is no longer useful. Here's the information RT had about your subscription:
642 DashboardID: { $SubscriptionObj->SubValue('DashboardId') }
643 Frequency: { $SubscriptionObj->SubValue('Frequency') }
644 Hour: { $SubscriptionObj->SubValue('Hour') }
646 $SubscriptionObj->SubValue('Frequency') eq 'weekly'
647 ? "Day of week: " . $SubscriptionObj->SubValue('Dow')
648 : $SubscriptionObj->SubValue('Frequency') eq 'monthly'
649 ? "Day of month: " . $SubscriptionObj->SubValue('Dom')
655 Name => 'Custom Field Transaction',
656 Description => 'Custom field value changed',
657 Content => q[Subject: {$Transaction->BriefDescription()}
659 {RT->Config->Get('WebURL')}Ticket/Display.html?id={$Ticket->id}
661 {$Transaction->Content()}
668 { Description => 'On Correspond Open Tickets',
669 ScripCondition => 'On Correspond',
670 ScripAction => 'Open Tickets',
671 Template => 'Blank' },
672 { Description => 'On Owner Change Notify Owner',
673 ScripCondition => 'On Owner Change',
674 ScripAction => 'Notify Owner',
675 Template => 'Transaction' },
676 { Description => 'On Create Autoreply To Requestors',
677 ScripCondition => 'On Create',
678 ScripAction => 'AutoReply To Requestors',
679 Template => 'AutoReply' },
680 { Description => 'On Create Notify AdminCcs',
681 ScripCondition => 'On Create',
682 ScripAction => 'Notify AdminCcs',
683 Template => 'Transaction' },
684 { Description => 'On Correspond Notify AdminCcs',
685 ScripCondition => 'On Correspond',
686 ScripAction => 'Notify AdminCcs',
687 Template => 'Admin Correspondence' },
688 # { Description => 'On Correspond Notify Requestors and Ccs',
689 # ScripCondition => 'On Correspond',
690 # ScripAction => 'Notify Requestors And Ccs',
691 # Template => 'Correspondence' },
692 # { Description => 'On Correspond Notify Other Recipients',
693 # ScripCondition => 'On Correspond',
694 # ScripAction => 'Notify Other Recipients',
695 # Template => 'Correspondence' },
696 { Description => 'On Correspond Notify Requestors, Ccs, and Other Recipients',
697 ScripCondition => 'On Correspond',
698 ScripAction => 'Notify Requestors, Ccs, and Other Recipients',
699 Template => 'Correspondence', },
700 { Description => 'On Comment Notify AdminCcs as Comment',
701 ScripCondition => 'On Comment',
702 ScripAction => 'Notify AdminCcs As Comment',
703 Template => 'Admin Comment' },
704 { Description => 'On Comment Notify Other Recipients as Comment',
705 ScripCondition => 'On Comment',
706 ScripAction => 'Notify Other Recipients As Comment',
707 Template => 'Correspondence' },
708 { Description => 'On Resolve Notify Requestors',
709 ScripCondition => 'On Resolve',
710 ScripAction => 'Notify Requestors',
711 Template => 'Resolved' },
712 { Description => "On transaction, add any tags in the transaction's subject to the ticket's subject",
713 ScripCondition => 'On Transaction',
714 ScripAction => 'Extract Subject Tag',
715 Template => 'Blank' },
716 { Description => 'On Correspond, cancel future resolve',
717 ScripCondition => 'On Correspond',
718 ScripAction => 'Cancel Scheduled Resolve',
719 Template => 'Blank' },
723 { UserId => 'root', # - principalid
724 Right => 'SuperUser', },
726 { GroupDomain => 'SystemInternal',
727 GroupType => 'privileged',
728 Right => 'ShowApprovalsTab', },
732 # Predefined searches
735 { Name => 'Search - My Tickets',
736 Description => '[_1] highest priority tickets I own', # loc
738 { Format => q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
739 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
740 . q{Priority, QueueName, ExtendedStatus},
741 Query => " Owner = '__CurrentUser__' AND ( Status = 'new' OR Status = 'open')",
742 OrderBy => 'Priority',
746 { Name => 'Search - Unowned Tickets',
747 Description => '[_1] newest unowned tickets', # loc
750 { Format => q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
751 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
752 . q{QueueName, ExtendedStatus, CreatedRelative, }
753 . q{'<A HREF="__WebPath__/Ticket/Display.html?Action=Take&id=__id__">__loc(Take)__</a>/TITLE:NBSP'},
754 Query => " Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')",
755 OrderBy => 'Created',
759 { Name => 'Search - Bookmarked Tickets',
760 Description => 'Bookmarked Tickets', #loc
762 { Format => q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',}
763 . q{'<a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',}
764 . q{Priority, QueueName, ExtendedStatus, Bookmark},
765 Query => "id = '__Bookmarked__'",
766 OrderBy => 'LastUpdated',
770 Name => 'HomepageSettings',
771 Description => 'HomepageSettings',
777 name => 'My Tickets', # loc
781 name => 'Unowned Tickets' # loc
785 name => 'Bookmarked Tickets' # loc
789 name => 'QuickCreate' # loc
796 name => 'MyReminders' # loc
800 name => 'Quicksearch' # loc
804 name => 'Dashboards' # loc
808 name => 'RefreshHomepage' # loc
816 # Obsolete/erroneous scrips
818 # $Delete_Scrips{conditionname}{actionname}{templatename}
819 # exists, and the scrip was created by the system user, it
820 # will be deleted on upgrade. Lowercase all the names here.
824 'notify requestors and ccs' => { 'correspondence' => 1 },
825 'notify other recipients' => { 'correspondence' => 1 },
831 push @ScripActions, (
833 { Name => 'Extract Custom Field Values', # loc
834 Description => 'extract cf-values out of a message', # loc
835 ExecModule => 'ExtractCustomFieldValues' },
837 { Name => 'Extract Custom Field Values With Code in Template', # loc
838 Description => 'extract cf-values out of a message with a Text::Template template', # loc
839 ExecModule => 'ExtractCustomFieldValuesWithCodeInTemplate' }
845 Name => 'CustomFieldScannerExample', # loc
846 Description => 'Example Template for ExtractCustomFieldValues', # loc
847 Content => <<'EOTEXT'
849 # CF Name | Header name or "Body" | MatchString(re) | Postcmd | Options
851 #### Allowed Options:
853 # q - (quiet) Don't record a transaction for adding the custom field
855 # * - (wildcard) The MatchString regex should contain _two_
856 # capturing groups, the first of which is the CF name,
857 # the second of which is the value. If this option is
858 # given, the <cf-name> field is ignored.
862 # 1. Put the content of the "X-MI-Test" header into the "testcf"
864 # testcf|X-MI-Test|.*
866 # 2. Scan the body for Host:name and put name into the "bodycf" custom
868 # bodycf|Body|Host:\s*(\w+)
870 # 3. Scan the "X-MI-IP" header for an IP-Adresse and get the hostname
871 # by reverse-resolving it:
872 # Hostname|X-MI-IP|\d+\.\d+\.\d+\.\d+|use Socket; ($value) = gethostbyaddr(inet_aton($value),AF_INET);
874 # 4. scan the "CC" header for an many email addresses, and add them to
875 # a custom field named "parsedCCs". If "parsedCCs" is a multivalue
876 # CF, then this should yield separate values for all email adress
878 # parsedCCs|CC|.*|$value =~ s/^\s+//; $value =~ s/\s+$//;
880 # 5. Looks for an "Email:" field in the body of the email, then loads
881 # up that user and makes them privileged The blank first field
882 # means the automatic CustomField setting is not invoked.
883 # |Body|Email:\s*(.+)$|my $u = RT::User->new($RT::SystemUser); $u->LoadByEmail($value); $u->SetPrivileged(1)|
885 # 6. Looks for any text of the form "Set CF Name: Value" in the body,
886 # and sets the CF named "CF Name" to the given value, which may be
887 # multi-line. The '*' option controls the wildcard nature of this
890 # !Body!^Set ([^\n:]*?):\s*((?s).*?)(?:\Z|\n\Z|\n\n)!!*
892 # 7. Looks for the regex anywhere in the headers and stores the match
893 # in the AllHeaderSearch CF
894 # AllHeaderSearch|Headers|Site:\s*(\w+)
896 # 8. If you need to dynamically build your matching, and want to trigger on headers and body
897 # and invode some arbitrary code like example 5
900 # my $action = 'use My::Site; My::Site::SetSiteID( Ticket => $self->TicketObj, Site => $_ );';
902 # for my $regex (My::Site::ValidRegexps) {
903 # for my $from ('headers', 'body') {