stalker.models.ticket.Ticket¶
-
class
stalker.models.ticket.Ticket(project=None, links=None, priority=’TRIVIAL’, summary=None, **kwargs)[source]¶ Bases:
stalker.models.entity.Entity,stalker.models.mixins.StatusMixinTickets are the way of reporting errors or asking for changes.
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
Config.ticket_workflowdictionary.In the default setup, there are four actions available;
accept,resolve,reopen,reassign, and five statuses availableNew,Assigned,Accepted,Reopened,Closed.Parameters: - project (
Project) – The Project that this Ticket is assigned to. A Ticket in Stalker must be assigned to a Project.projectargument can not be skipped or can not be None. - summary (str) – A string which contains the title or a short description of this Ticket.
- priority (enum) –
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 - reported_by – An instance of
Userwho created this Ticket. It is basically a synonym for theSimpleEntity.created_byattribute.
Changing the
Ticket.:attr`.Ticket.status` will create a newTicketLoginstance showing the previous operation.Even though Tickets needs statuses they don’t need to be supplied a
StatusListnorStatusfor the Tickets. It will be automatically filled accordingly. For newly created Tickets the status of the ticket isNEWand 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
Ticket.nameis automatically generated by using thestalker.config.Config.ticket_labelattribute andTicket.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
Ticket.resolve(),Ticket.reassign(),Ticket.accept(),Ticket.reopen()methods to change the status of the current Ticket.Changing the status of the Ticket will create
TicketLogentries reflecting the change made.-
__init__(project=None, links=None, priority=’TRIVIAL’, summary=None, **kwargs)¶
Methods
__init__([project, links, priority, summary])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
commentsA list of Noteinstances showing the comments made for this Ticket instance.created_byThe Userwho has created this object.created_by_idThe id of the Userwho has created this entity.date_createdA datetime.datetimeinstance showing the creation date and time of this object.date_updatedA datetime.datetimeinstance showing the update date and time of this object.descriptionDescription of this object. entity_groupsentity_identity_typegeneric_dataThis attribute can hold any kind of data which exists in SOM. generic_textThis attribute can hold any text. html_classhtml_styleidlinkslogsmetadatanameName of this object nice_nameNice name of this object. notesAll the Notess attached to this entity.numberThe automatically generated number for the tickets. ownerowner_idplural_class_namethe plural name of this class priorityThe priority of the Ticket which is an enum value. projectreturns the project attribute project_idqueryrelated_ticketsA list of other Ticket instances which are related to this one. reported_byShows who created this Ticket resolutionstatusThe current status of the object. status_idstatus_liststatus_list_idsummarytagsA list of tags attached to this object. thumbnailthumbnail_idticket_idtjp_idreturns TaskJuggler compatible id to_tjprenders a TaskJuggler compliant string used for TaskJuggler typeThe type of the object. type_idThe id of the Typeof this entity.updated_byThe Userwho has updated this object.updated_by_idThe id of the Userwho has updated this entity.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
-
comments¶ A list of
Noteinstances showing the comments made for this Ticket instance. It is a synonym for theTicket.notesattribute.
-
reported_by¶ Shows who created this Ticket
-
priority¶ 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
-
number¶ The automatically generated number for the tickets.
-
project¶ returns the project attribute
-
date_created¶ A
datetime.datetimeinstance showing the creation date and time of this object.
-
date_updated¶ A
datetime.datetimeinstance showing the update date and time of this object.
-
description¶ Description of this object.
-
generic_data¶ This attribute can hold any kind of data which exists in SOM.
-
generic_text¶ This attribute can hold any text.
-
name¶ Name of this object
-
nice_name¶ 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.
-
notes¶ All the
Notess attached to this entity.It is a list of
Noteinstances or an empty list, setting it to None will raise a TypeError.
-
plural_class_name¶ the plural name of this class
-
status¶ The current status of the object.
It is a
Statusinstance which is one of the Statuses stored in thestatus_listattribute of this object.
A list of tags attached to this object.
It is a list of
Taginstances which shows the tags of this object
-
tjp_id¶ returns TaskJuggler compatible id
-
to_tjp¶ renders a TaskJuggler compliant string used for TaskJuggler integration. Needs to be overridden in inherited classes.
-
type¶ The type of the object.
It is a
Typeinstance with a properType.target_entity_type.
- project (