1 - I have a MonitoredQueue that sets tickets to "Monitored"
2 if its subject matches /monitored/.
4 - I want to have a kind of Ticket that are 'Monitored'.
5 - I want all monitored tickets, when they are overdue for
7 - send notification to manager
9 - I want all monitored tickets, when they are overdue for
12 - I want to query all tickets that are monitored as such
13 - I want to modify 14 => 15 and have it affect all existing
14 tickets that are monitored
17 - I want to add a new "overdue for 27 days, add a 'ultimatum'
18 correspondence to it" rule for all monitored tickets.
19 - I want to add a new "overdue for 27 days, add a 'ultimatum'
20 correspondence to it" rule for all _new_ monitored tickets
21 without affecting existing ones.
24 - The user of OrderRequest queue needs to fill a numeric "CF",
26 - On creation, it needs to create following approvals:
27 - "Manager" approval if CF.Price is > 1000
28 - "President" approval if CF.Price is > 2000
29 - When all of "M", "P" are resolved (if any, or if there were none
30 to begin with), Create a new approval, "Finance".
31 - If any approvals above is rejected, reject the original ticket.
32 - If "Finance" is resolved, resolve original ticket.
33 - If "Finance" is rejected, create an approval for "CEO".
34 - If "CEO" is resolved, resolve the original ticket.
35 - If "CEO" is rejected, reject the original ticket.
37 [RuleAction CreateTicketWithRuleset]
38 -> ReleaseMyLockOnRuleset $ruleset
39 -> UnlessLockOnRuleset $ruleset
40 # i.e. if no active tickets still have a lock on it
41 -> ForceCreateTicketWithRuleset $ruleset
44 -> Condition: OnCreate
45 Action: AddTicketRuleSet "PurchaseApproval"
46 # Triggers immediately
48 [RuleSet: PurchaseApproval]
49 -> Condition: OnCreate
50 Condition: CF.Price > 1000
51 Action: CreateTicketWithRuleset "ManagerApproval"
52 -> Condition: OnCreate
53 Condition: CF.Price > 2000
54 Action: CreateTicketWithRuleset "PresidentApproval"
55 -> Condition: OnCreate
56 Action: CreateTicketWithRuleset "FinanceApproval"
57 -> Condition: OnReject
60 [RuleSet: ManagerApproval]
61 -> Condition: OnCreate
62 Action: Prohibit Ruleset "FinanceApproval"
63 -> Condition: OnResolve
64 Action: CreateTicketWithRuleset "FinanceApproval"
65 -> Condition: OnReject
66 Action: RejectTicket TOP
68 [RuleSet: PresidentApproval]
69 -> Condition: OnCreate
70 Action: Prohibit CreateTicketWithRuleset "FinanceApproval"
71 -> Condition: OnResolve
72 Action: CreateTicketWithRuleset "FinanceApproval"
73 -> Condition: OnReject
74 Action: RejectTicket TOP
76 [RuleSet: FinanceApproval]
77 -> Condition: OnCreate
78 Action: Prohibit RuleSet "CEOApproval"
79 -> Condition: OnResolve
80 Action: ResolveTicket TOP
81 -> Condition: OnReject
82 Action: CreateTicketWithRuleset "CEOApproval"
84 [RuleSet: CEOApproval]
85 -> Condition: OnResolve
86 Action: ResolveTicket TOP
87 -> Condition: OnReject
88 Action: RejectTicket TOP
92 Prohibit Ticket Operation:
102 [TOP] --> [M] --> [F]
115 isa_ok( $Approval->Type, 'RT::Ticket' );
116 is( $Approval->Workflow->Name, 'W' );
117 is( $Approval->Stage->Name, 'Approval' );
131 -> Rule: OnCreate RunStage Approval
133 ok( TicketA->Rules->HasEntry($ApprovalRule) )
134 ok( TicketB->Rules->HasEntry($ApprovalRule) )
137 -> Rule: OnResolve RunStage SUCCESS
138 -> Rule: OnReject RunStage FAIL
141 -> Rule: OnCreate SetStatus('resolved') TOP
144 -> Rule: OnCreate SetStatus('rejected') TOP
147 - Rule FOO: OnAnything {
148 CreateTicketIfNotBlocked StageFOO
149 AddLink DependedOnBy TOP to Stage1
150 AssignRule DoStage2 to Stage1
151 AssignRule DoStage3 to Stage1
153 - Rule BAR: OnAnything {
154 CreateTicketIfNotBlocked StageBAR
160 [TOP] ==> [Stage1] ==> [Stage3]
165 $self->Ticket->Queues->Scrips->Apply
168 $self->Ticket->Queues->Scrips->Apply
172 $self->Ticket->Queues->Scrips->Apply
173 ->Stages->Scrips->Apply
186 [TOP] => [Stage1] => [Stage2] => [END]
187 `- => [Stage3] => [END]