1RT-CRONTOOL(1) User Contributed Perl Documentation RT-CRONTOOL(1)
2
3
4
6 rt-crontool - a tool to act on tickets from an external scheduling tool
7
9 # find all active tickets in the queue 'general' and set their priority to 99 if they are overdue:
10 rt-crontool \
11 --search RT::Search::ActiveTicketsInQueue --search-arg general \
12 --condition RT::Condition::Overdue \
13 --action RT::Action::SetPriority --action-arg 99 \
14 --verbose
15
16 # Escalate tickets
17 rt-crontool \
18 --search RT::Search::ActiveTicketsInQueue --search-arg general \
19 --action RT::Action::EscalatePriority
20
21 # Process tickets in parallel
22 rt-crontool \
23 --search RT::Search::ActiveTicketsInQueue --search-arg general \
24 --action RT::Action::SomeTimeConsumingAction
25 --max-processes 10 --max-tickets-per-process 100
26
27 # Combine multiple actions:
28 # Find all tickets that are 'new' or 'stalled' and set their priority to 99 if they are overdue
29 # also, escalate them and set their status to open:
30 rt-crontool \
31 --search RT::Search::FromSQL \
32 --search-arg "(Status='new' OR Status = 'stalled')" \
33 --condition RT::Condition::Overdue \
34 --action RT::Action::SetPriority \
35 --action-arg 99 \
36 --action RT::Action::LinearEscalate \
37 --action-arg "RecordTransaction: 1" \
38 --action RT::Action::SetStatus \
39 --action-arg open
40
42 This script is a tool to act on tickets from an external scheduling
43 tool, such as cron.
44
45 Security:
46
47 This tool allows the user to run arbitrary perl modules from within RT.
48 If this tool were setgid, a hostile local user could use this tool to
49 gain administrative access to RT. It is incredibly important that
50 nonprivileged users not be allowed to run this tool. It is suggested
51 that you create a non-privileged unix user with the correct group
52 membership and RT access to run this tool.
53
55 search
56 Specify the search module you want to use
57
58 search-arg
59 An argument to pass to --search
60
61 condition
62 Specify the condition module you want to use
63
64 condition-arg
65 An argument to pass to --condition
66
67 action
68 Specify the action module you want to use.
69
70 This option may be repeated to apply multiple actions to found
71 tickets.
72
73 action-arg
74 An argument to pass to --action.
75
76 This option may be repeated to pass corresponding arguments to
77 multiple calls of --action. In this case, each --action-arg option
78 must come after the --action argument it applies to. Actions with
79 no --action-arg must come at the end.
80
81 template
82 Specify name or id of template(s) you want to use
83
84 transaction
85 Specify if you want to use either 'first', 'last' or 'all'
86 transactions
87
88 transaction-type
89 Specify the comma separated list of transactions' types you want to
90 use
91
92 reload-ticket
93 Reload ticket before processing in tickets iteration. This is to
94 refresh ticket metadata, which is useful especially for long-
95 running jobs.
96
97 max-processes
98 Specify the max number of children to maintain. This implies
99 parallel processing, which is false by default.
100
101 max-tickets-per-process
102 Specify the max number of tickets to process in each child. Only
103 take effect with --max-processes. Default is 100.
104
105 log Adjust LogToSTDERR config option
106
107 verbose
108 Output status updates to STDOUT
109
110 dry-run
111 Actions are composed of 2 parts: "Prepare" and "Commit". "dry-run"
112 skips the "Commit" part.
113
114
115
116perl v5.38.0 2023-10-22 RT-CRONTOOL(1)