A Beginner’s Guide To Develop osTicket Plugin

Create new plugins to add custom features into your osTicket installation. Add enhanced functionality to meet needs of your agents and customers.

A Beginner’s Guide To Develop osTicket Plugin

osTicket is an open source ticketing based helpdesk system designed for customers to report their queries and complaints to support staff. This free support system provides easy to use inquires management module that converts inquiries coming from phone, email and forms into web-based tickets. It offers wide range of features and options that enables support staff to provide incredible client support experience for customers. osTicket is an entirely flexible support ticket framework that offers numerous options to help tailor all parts of client support experience like messages sent to client, pages and notifications. Int his article, we will learn osTicket plugin development to enhance functionality according to our needs. To do that, we will cover following topics:

Why to Use Plugins?

In this topic we will learn how to create a simple plugin to extend osTicket’s core functionality. A plugin is a piece of software, that extends the core functionality of any app/software. Following are some reasons for apps to support plugins:

  • It allows third party developers to create software components which extend the functionality of an application.
  • Plugins allow to easily integrate new features.
  • Also it doesn’t increase the size and complexity of an application.
  • As well as developers can keep and manage plugins’ code separately from core application.


  • PHP version 5.6 or above
  • osTicket installation
  • Basic PHP Knowledge

How to Develop osTicket’s Plugin?

  • Create plugin’s folder in <ROOT>/include/plugins directory. In this tutorial we will create a demo plugin which integrates osTicket with Redmine.
  • It should have following necessary files: plugin.php and config.php.
  • plugin.php file contains general description of the plugin. Use following sample code in plugin.php file:

return array(
    'id' =>             'dynabic:redmine', # notrans
    'version' =>        '0.1',
    'name' =>           /* trans */ 'Dynabic Redmine',
    'author' =>         'Bilal Kiani',
    'description' =>    /* trans */ 'Integration with Dynabic.Redmine',
    'url' =>            '',
    'plugin' =>         'redmine.php:DynabicRedminePlugin',

  • Then replace id, name, author name and plugin class names from above code.
  • After that, we need to display plugin configuration options into osTicket’s backend. Add following sample code into config.php file.
require_once INCLUDE_DIR . 'class.plugin.php';
class DynabicRedminePluginConfig extends PluginConfig {

    // Provide compatibility function for versions of osTicket prior to
    // translation support (v1.9.4)
    function translate() {
        if (!method_exists('Plugin', 'translate')) {
            return array(
                function($x) { return $x; },
                function($x, $y, $n) { return $n != 1 ? $y : $x; },
        return Plugin::translate('dynabic-redmine');

    function getOptions() {
        list($__, $_N) = self::translate();        
        return array(
            'dynabicRedmineCredentials' => new SectionBreakField(array(
                'label' => $__('Redmine Credentials')
            'dynabic-Redmine-username' => new TextboxField(array(
                'label' => $__('Username'),
                'configuration' => array('size'=>60, 'length'=>100),                
            'dynabic-Redmine-password' => new PasswordField(array(
                'label' => $__('Password'),
                'configuration' => array('size'=>60, 'length'=>100),                
  • As a result, this will create username and password fields on config page as shown here:
A Beginner’s Guide To Develop osTicket Plugin
  • The following is a list of class fields that are available, they are defined in [INSTALL_ROOT]/include/class.forms.php:
    • TextboxField – text box
    • TextareaField – text area
    • ThreadEntryField – rich text area, used for discussion threads
    • DatetimeField – JQuery datepicker
    • PhoneField – text box optimized for phone numbers
    • BooleanField – checkbox
    • ChoiceField – drop-down select field
    • SectionBreakField – horizontal section break
  • After that, we need to create the file where plugin’s functionality will be defined.
  • File name should be same as defined in plugin.php file. i.e redmine.php.
  • This will must hold the class DynabicRedminePlugin. Check out following sample code:
class DynabicRedminePlugin extends Plugin {
    var $config_class = "DynabicRedminePluginConfig";
     * The Redmine WSDL endpoint.

    function bootstrap() {
        $config = $this->getConfig();
        # ----- Dynabic.Redmine credentials ---------------------
        $dynabicRedmine = json_decode($config->get('dynabicRedmine-enabled'));
		define('Redmine_USERNAME', $config->get('dynabic-Redmine-username'));
		define('Redmine_PASSWORD', $config->get('dynabic-Redmine-password'));
  • This code fetched the configuration values and you can use these values in your functions. In this file you can add your plugin’s functionality as your requirements.


OsTicket is a ticketing management software which offers plugins structure for developers so they can add new functionality as per requirements. Plugins are the components that extend the core functionality of any app/software. Int his article we have discussed osticket plugin development, which helps developers to add custom feature and enhancements according to their requirements..


Best Open Source and Free IT Help Desk Software

Popular Free Ticketing Based Helpdesk and Customer Care System

How To Set Up Online Help Desk Software Using osTicket

How to Implement Multi-tenancy in osTicket

Automate ticketing system using WordPress and osTicket