Bases: stalker.models.entity.Entity, stalker.models.mixins.StatusMixin
Tickets are the way of reporting errors or asking for changes in Stalker.
The Stalker Ticketing system is based on Trac Basic Workflow. For more information please visit Trac Workflow
Trac Workflow:: http://trac.edgewall.org/wiki/TracWorkflow
Stalker Ticket system is very flexible, to customize the workflow please update the ticket_workflow dictionary.
In the default setup, there are four actions available; accept, resolve, reopen, reassign, and five statuses available New, Assigned, Accepted, Reopened, Closed.
Parameters: |
|
---|
Changing the Ticket. :attr`~stalker.models.ticket.Ticket.status` will create a new TicketLog instance showing the previous operation.
Even though Tickets needs statuses they don’t need to be supplied a StatusList nor Status for the Tickets. It will be automatically filled accordingly. For newly created Tickets the status of the ticket is NEW and can be changed to other statuses as follows:
Status -> Action -> New Status
NEW -> resolve -> CLOSED NEW -> accept -> ACCEPTED NEW -> reassign -> ASSIGNED
ASSIGNED -> resolve -> CLOSED ASSIGNED -> accept -> ACCEPTED ASSIGNED -> reassign -> ASSIGNED
ACCEPTED -> resolve -> CLOSED ACCEPTED -> accept -> ACCEPTED ACCEPTED -> reassign -> ASSIGNED
REOPENED -> resolve -> CLOSED REOPENED -> accept -> ACCEPTED REOPENED -> reassign -> ASSIGNED
CLOSED -> reopen -> REOPENED
actions available: resolve reassign accept reopen
The name is automatically generated by using the stalker.config.Config.ticket_label attribute and ticket_number. So if defaults are used the first ticket name will be “Ticket#1” and the second “Ticket#2” and so on. For every project the number will restart from 1.
Use the resolve(), reassign(), accept(), reopen() methods to change the status of the current Ticket.
Changing the status of the Ticket will create TicketLog entries reflecting the change made.
Methods
__init__([project, links, priority]) | |
accept([created_by]) | accepts the ticket |
del_resolution(*args) | deletes the timing_resolution |
reassign([created_by, assign_to]) | reassigns the ticket |
reopen([created_by]) | reopens the ticket |
resolve([created_by, resolution]) | resolves the ticket |
set_owner(*args) | sets owner to the given owner |
set_resolution(*args) | sets the timing_resolution |
Attributes
comments | A list of Note instances showing |
created_by | The User who has created this object. |
created_by_id | The id of the User who has created |
date_created | A datetime.datetime instance showing the creation date and time of this object. |
date_updated | A datetime.datetime instance showing the update date and time of this object. |
description | Description of this object. |
entity_id | |
entity_type | |
generic_data | This attribute can hold any kind of data which exists in SOM. |
id | |
links | |
logs | |
metadata | A collection of Table objects and their associated schema |
name | Name of this object |
nice_name | Nice name of this object. |
notes | All the Notess attached to this entity. |
number | The automatically generated number for the tickets. |
owner | |
owner_id | |
plural_class_name | the plural name of this class |
priority | The priority of the Ticket which is an enum value. |
project | returns the project attribute |
project_id | |
query | ORM-level SQL construction object. |
related_tickets | A list of other Ticket instances which are related |
reported_by | Shows who created this Ticket |
resolution | |
status | The current status of the object. |
status_id | |
status_list | |
status_list_id | |
tags | A list of tags attached to this object. |
thumbnail | |
thumbnail_id | |
ticket_id | |
tjp_id | returns TaskJuggler compatible id |
to_tjp | renders a TaskJuggler compliant string used for TaskJuggler |
type | The type of the object. |
type_id | The id of the Type of this entity. |
updated_by | The User who has updated this object. |
updated_by_id | The id of the User who has updated |
A list of other Ticket instances which are related to this one. Can be used to related Tickets to point to a common problem. The Ticket itself can not be assigned to this list
A list of Note instances showing the comments made for this Ticket instance. It is a synonym for the notes attribute.
Shows who created this Ticket
The priority of the Ticket which is an enum value. Possible values are:
0 / TRIVIAL defect with little or no impact / cosmetic enhancement 1 / MINOR defect with minor impact / small enhancement 2 / MAJOR defect with major impact / big enhancement 3 / CRITICAL severe loss of data due to the defect or highly needed enhancement 4 / BLOCKER basic functionality is not available until this is fixed
The automatically generated number for the tickets.
returns the project attribute
A datetime.datetime instance showing the creation date and time of this object.
A datetime.datetime instance showing the update date and time of this object.
Description of this object.
This attribute can hold any kind of data which exists in SOM.
Name of this object
Nice name of this object.
It has the same value with the name (contextually) but with a different format like, all the white spaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lower case.
All the Notess attached to this entity.
It is a list of Note instances or an empty list, setting it None will raise a TypeError.
the plural name of this class
The current status of the object.
It is a Status instance which is one of the Statuses stored in the status_list attribute of this object.
A list of tags attached to this object.
It is a list of Tag instances which shows the tags of this object
returns TaskJuggler compatible id
renders a TaskJuggler compliant string used for TaskJuggler integration. Needs to be overridden in inherited classes.
The type of the object.
It is an instance of Type with a proper target_entity_type.