RT Python Library
RT Python Library
object):
:term:`API` for Request Tracker according to
http://requesttracker.wikia.com/wiki/REST. Interface is based on
:term:`REST` architecture, which is based on HTTP/1.1 protocol. This module
is therefore mainly sending and parsing special HTTP messages.
id: <ticket-id>
Action: comment
Text: the text comment
second line starts with the same indentation as first
Attachment: an attachment filename/path
Example::
content=id: ticket/new
Queue: General
Owner: Nobody
Requestors: [email protected]
Subject: Ticket created through REST API
Text: Lorem Ipsum
RT/3.8.7 200 Ok
Otherwise::
RT/3.8.7 200 Ok
* Name
* Description
* CorrespondAddress
* CommentAddress
* InitialPriority
* FinalPriority
* DefaultDueIn
* Name
* Password
* EmailAddress
* RealName
* NickName
* Gecos
* Organization
* Address1
* Address2
* City
* State
* Zip
* Country
* HomePhone
* WorkPhone
* MobilePhone
* PagerPhone
* ContactInfo
* Comments
* Signature
* Lang
* EmailEncoding
* WebEncoding
* ExternalContactInfoId
* ContactInfoSystem
* ExternalAuthId
* AuthSystem
* Privileged
* Disabled
* Transaction
* ContentType
* Parent
* Creator
* Created
* Filename
* Content (bytes type)
* Headers
* MessageId
* ContentEncoding
* id
* Subject
* Delivered-To
* From
* Return-Path
* Content-Length
* To
* X-Seznam-User
* X-QM-Mark
* Domainkey-Signature
* RT-Message-ID
* X-RT-Incoming-Encryption
* X-Original-To
* Message-ID
* X-Spam-Status
* In-Reply-To
* Date
* Received
* X-Country
* X-Spam-Checker-Version
* X-Abuse
* MIME-Version
* Content-Type
* Subject
Format of message::
RT/3.8.7 200 Ok
get_attachments(self, ticket_id)
Get attachment list for a given ticket
get_attachments_ids(self, ticket_id)
Get IDs of attachments for given ticket.
get_links(self, ticket_id)
Gets the ticket links for a single ticket.
* id
* Members
* MemberOf
* RefersTo
* ReferredToBy
* DependsOn
* DependedOnBy
get_queue(self, queue_id)
Get queue details.
* id
* Name
* Description
* CorrespondAddress
* CommentAddress
* InitialPriority
* FinalPriority
* DefaultDueIn
get_short_history(self, ticket_id)
Get set of short history items
get_ticket(self, ticket_id)
Fetch ticket by its ID.
* id
* Queue
* Owner
* Creator
* Subject
* Status
* Priority
* InitialPriority
* FinalPriority
* Requestors
* Cc
* AdminCc
* Created
* Starts
* Started
* Due
* Resolved
* Told
* TimeEstimated
* TimeWorked
* TimeLeft
:raises UnexpectedMessageFormat: Unexpected format of returned message.
get_user(self, user_id)
Get user details.
* Lang
* RealName
* Privileged
* Disabled
* Gecos
* EmailAddress
* Password
* id
* Name
* RealName
* Disabled
* EmailAddress
* Password
* id
* Name
.. note::
:keyword login: Username used for RT, if not supplied together with
*password* :py:attr:`~Rt.default_login` and
:py:attr:`~Rt.default_password` are used instead
:keyword password: Similarly as *login*
:returns: ``True``
Successful login
``False``
Otherwise
:raises AuthorizationError: In case that credentials are not supplied neither
during inicialization or call of this method.
logout(self)
Logout of user.
:returns: ``True``
Successful logout
``False``
Logout failed (mainly because user was not login)
new_correspondence(self, queue=None)
Obtains tickets changed by other users than the system one.
:returns: List of tickets which were last updated by other user than
the system one ordered in decreasing order by LastUpdated.
Each ticket is dictionary, the same as in
:py:meth:`~Rt.get_ticket`.
id: <ticket-id>
Action: correspond
Text: the text comment
second line starts with the same indentation as first
Cc: <...>
Bcc: <...>
TimeWorked: <...>
Attachment: an attachment filename/path
Example::
steal(self, ticket_id)
Steal ticket
take(self, ticket_id)
Take ticket
untake(self, ticket_id)
Untake ticket
----------------------------------------------------------------------
Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
----------------------------------------------------------------------
Data and other attributes defined here: