Difference between revisions of "ManualScrips"

From Request Tracker Wiki
Jump to navigation Jump to search
m
 
(4 intermediate revisions by 3 users not shown)
Line 5: Line 5:
== Scrips ==
== Scrips ==


A script performs some action when some conditions are met. Many actions use a template. You can read a scrip as a sentence like: When <condition>, do <action> with <template>. When creating a Scrip, it is helpful to make the "Description" field a user-friendly phrase such as "Send replies to Requestor and Cc users" because users see that description in '''bold''' on the ticket update composition page.
Official docs can be found here: https://docs.bestpractical.com/rt/latest/customizing/scrip_conditions_and_action.html
 
A scrip performs some action when some conditions are met. Many actions use a template. You can read a scrip as a sentence like: When <condition>, do <action> with <template>. When creating a Scrip, it is helpful to make the "Description" field a user-friendly phrase such as "Send replies to Requestor and Cc users" because users see that description in '''bold''' on the ticket update composition page.


=== Table 1: Conditions  ===
=== Table 1: Conditions  ===
Line 58: Line 60:
Note: don't create a global scrip using the "On Create" condition and the "Create Ticket" scrip action. This will create a loop.
Note: don't create a global scrip using the "On Create" condition and the "Create Ticket" scrip action. This will create a loop.


User Defined Condition:
        $self->ScripObj              RT::Scrip,
        $self->TicketObj              RT::Ticket,
        $self->TransactionObj        RT::Transaction,
=== Table 2: Actions ===
=== Table 2: Actions ===


Line 105: Line 111:
|}
|}


Not clear what the difference is between Auto Reply and Notify Requestors
Custom Action Commit/Preparation Code:
 
        $self->ScripActionObj  RT::ScripAction,
=== Custom condition ===
        $self->ScripObj        RT::Scrip,
 
        $self->TemplateObj      RT::Template,
You can customize conditions to fit your needs better. It would be good to find some information about the condition syntax. It would be good if there were reference information inserted here, too.
        $self->TicketObj        RT::Ticket,
 
        $self->TransactionObj  RT::Transaction,
----
 
Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApache]]
Prev: [[ManualRights]] --- Up: [[UserManual]] --- Next: [[ManualApache]]
[[Category:RT User Manual]]
[[Category:RT User Manual]]
[[Category:RT44]]

Latest revision as of 14:51, 2 April 2019

Prev: ManualRights --- Up: UserManual --- Next: ManualApprovals

Appendix 3

Scrips

Official docs can be found here: https://docs.bestpractical.com/rt/latest/customizing/scrip_conditions_and_action.html

A scrip performs some action when some conditions are met. Many actions use a template. You can read a scrip as a sentence like: When <condition>, do <action> with <template>. When creating a Scrip, it is helpful to make the "Description" field a user-friendly phrase such as "Send replies to Requestor and Cc users" because users see that description in bold on the ticket update composition page.

Table 1: Conditions

Condition Name What it means Possible Template
User Defined A user-defined condition (should be described below) User-defined templates
On Create When a new ticket is created Global template: Autoreply
On Transaction When a ticket is updated or changed in any way Global template: Transaction
On Reply When a watcher replies to a ticket Global template: Reply or Global template: Admin Reply
On Comment When a watcher comments on a ticket (privately) Global template: Admin Comment
On Correspond When a watcher corresponds to (replies to) a ticket (publicly) Global template: Blank
On Status When the ticket's status changes Global template: Status Changed
On Owner Change When the ticket gets a new owner Global template: Transaction
On Queue Change When the ticket is put in a different queue Global template: Transaction
On Resolve When the ticket is resolved (completed) Global template: Resolved

Note: don't create a global scrip using the "On Create" condition and the "Create Ticket" scrip action. This will create a loop.

User Defined Condition:

       $self->ScripObj               RT::Scrip,
       $self->TicketObj              RT::Ticket,
       $self->TransactionObj         RT::Transaction,

Table 2: Actions

Action Name What It Means
Auto Reply to Requestors Email an Auto Reply template to the ticket's requestor
Notify Requestors Email the ticket's requestor
Notify Owner As Comment Email the ticket's owner. "As Comment" means the return address of the email is RT's comment address and all responses will be posted as comments not visible to the requestor.
Notify Owner Email the ticket's owner.
Notify Admin Ccs As Comment Email the ticket's Admin Ccs. "As Comment" means the return address of the email is RT's comment address and all responses will be posted as comments not visible to the requestor.
Notify Admin Ccs Email the ticket's Admin Ccs.
Notify Requestors And Ccs As Comment Email the ticket's requestor and Ccs. "As Comment" means the return address of the email is RT's comment address and all responses will be posted as comments not visible to the requestor.
Notify Requestors And Ccs Email the ticket's requestor and Ccs.
Notify All Watchers As Comment Email the ticket's requestor, owner, Ccs, and Admin Ccs. "As Comment" means the return address of the email is RT's comment address and all responses will be posted as comments not visible to the requestor.
Notify All Watchers Email the ticket's requestor, owner, Ccs, and Admin Ccs.
Notify Other Recipients As Comment Email the addresses in the Cc: and Bcc: fields of a ticket's reply or comment. "As Comment" means the return address of the email is RT's comment address and all responses will be posted as comments not visible to the requestor.
Notify Other Recipients Email the addresses in the Cc: and Bcc: fields of a ticket's reply or comment
Open Tickets Automatically opens a stalled, resolved, or rejected ticket when anyone replies to it; automatically opens new tickets when anyone except the requestor replies to it. Does not apply to tickets that are already open.

Custom Action Commit/Preparation Code:

       $self->ScripActionObj   RT::ScripAction,
       $self->ScripObj         RT::Scrip,
       $self->TemplateObj      RT::Template,
       $self->TicketObj        RT::Ticket,
       $self->TransactionObj   RT::Transaction,

Prev: ManualRights --- Up: UserManual --- Next: ManualApache