Writing your own ticket system plugin

To write your own ticket system plugin it is easiest to use a Python library that accesses the API offered by the desired ticket system.

The plugin class inherits from the class TicketPlugin and needs to implement the following methods:

class argus.incident.ticket.base.TicketPlugin[source]
abstract static create_client(endpoint, authentication)[source]

Creates, authenticates and returns a client to connect with the given endpoint

Raises a TicketClientException in case of any errors

abstract classmethod create_ticket(serialized_incident: dict)[source]

Creates a ticket with the information of the given incident and returns its url

Raises a TicketCreationException in case of any errors

classmethod import_settings()[source]

Imports, validates and returns settings needed for ticket creation.

Raises a TicketSettingsException if settings are not set properly.

Your implementation of create_ticket should fetch the ticket plugin settings using import_settings. Following that, it should use create_client to fetch an object through which it can communicate with the ticket system API. Using these, it should create a ticket within the ticket system and return a URL that represents the ticket system’s display page for that ticket. This method is called within Argus when a user wants to create a ticket.