RT::Lifecycle - class to access and manipulate lifecycles
A lifecycle is a list of statuses that a ticket can have. There are three groups of statuses: initial, active and inactive. A lifecycle also defines possible transitions between statuses. For example, in the 'default' lifecycle, you may only change status from 'stalled' to 'open'.
It is also possible to define user-interface labels and the action a user should perform during a transition. For example, the "open -> stalled" transition would have a 'Stall' label and the action would be Comment. The action only defines what form is showed to the user, but actually performing the action is not required. The user can leave the comment box empty yet still Stall a ticket. Finally, the user can also just use the Basics or Jumbo form to change the status with the usual dropdown.
Simple constructor, takes no arguments.
Takes a name of the lifecycle and loads it. If name is empty or undefined then loads the global lifecycle with statuses from all named lifecycles.
Can be called as class method, returns a new object, for example:
my $lifecycle = RT::Lifecycle->Load('default');
Returns sorted list of the lifecycles' names.
Returns name of the laoded lifecycle.
Returns RT::Queues collection with queues that use this lifecycle.
Methods to get statuses in different sets or validating them.
Returns an array of all valid statuses for the current lifecycle. Statuses are not sorted alphabetically, instead initial goes first, then active and then inactive.
Takes optional list of status types, from 'initial', 'active' or 'inactive'. For example:
$lifecycle->Valid('initial', 'active');
Takes a status and returns true if value is a valid status for the current lifecycle. Otherwise, returns false.
Takes optional list of status types after the status, so it's possible check validity in particular sets, for example:
# returns true if status is valid and from initial or active set
$lifecycle->IsValid('some_status', 'initial', 'active');
See also </valid>.
Takes a status and returns its type, one of 'initial', 'active' or 'inactive'.
Returns an array of all initial statuses for the current lifecycle.
Takes a status and returns true if value is a valid initial status. Otherwise, returns false.
Returns an array of all active statuses for this lifecycle.
Takes a value and returns true if value is a valid active status. Otherwise, returns false.
Returns an array of all inactive statuses for this lifecycle.
Takes a value and returns true if value is a valid inactive status. Otherwise, returns false.
In some cases when status is not provided a default values should be used.
Takes a situation name and returns value. Name should be spelled following spelling in the RT config file.
Returns the status that should be used by default when ticket is created.
Returns the status that should be used when tickets are merged.
Returns the status that should be used when reminders are opened.
Returns the status that should be used when reminders are resolved.
Takes status and returns list of statuses it can be changed to.
Is status is empty or undefined then returns list of statuses for a new ticket.
If argument is ommitted then returns a hash with all possible transitions in the following format:
status_x => [ next_status, next_status, ... ],
status_y => [ next_status, next_status, ... ],
Takes two statuses (from -> to) and returns true if it's valid transition and false otherwise.
Takes two statuses (from -> to) and returns the right that should be checked on the ticket.
Registers all defined rights in the system, so they can be addigned to users. No need to call it, as it's called when module is loaded.
Returns hash with description of rights that are defined for particular transitions.
Takes a status and returns list of defined actions for the status. Each element in the list is a hash reference with the following key/value pairs:
Takes lifecycle as a name string or an object and returns a hash reference with move map from this cycle to provided.
Takes a lifecycle as a name string or an object and returns true if move map defined for move from this cycle to provided.
Takes no arguments and returns hash with pairs that has no move maps.
A class method that takes no arguments and returns list of strings that require translation.
← Back to index