Skip to content

garyns/osTicket-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osTicket-extensions

PLEASE NOTE: This code was written for and tested against OSTicket 1.6 and is currencly unmaintained. I have received notifications that this code does not work with OSTicket 1.10 due to schema changes.

Extensions and Scripts to complement self-hosted OSTicket. They include:

  • Automatically schedule and create tickets.
  • Process #hashtags in ticket notes and comments.
  • Simple managerial ticket report

Tested against OSTicket 1.8

Ticket Automation

In the "automation" directory are 2 php scripts for automating ticket creation.

Creating a ticket from the command line:

./createTicket.php subject [message]

Automatically scheduling ticket creation:

./createTicketPeriod.php <period>

This script is called from CRON to create tickets automatically on a schedule (eg daily, weekly, monthly, etc). Ticket subjects and messges are maintained in OSTicket's Knowledge-Base as an FAQ.

See here for further information and setup tutorial.

Troubleshooting

Unable to create ticket with subject: [subject]

Ticket creation has failed. The likely cause is because the script could not reach your OSTicket API URL. Check the $settings array key apiURL.

Unable to create ticket with subject [subject]: Valid API key required

The script found the OSTicket API URL but failed because the provided API Key was incorrect. Check the $settings array key apiKey. Also check the API Keys page in OSTicket for the correct APIKey and IP Address.

Simple HTML Reporting

A simple HTML managerial report to report on open and closed tickets. Here is a screen shot.

Background

These scripts were created to provide a client with some basic managerial reporting of tickets. There are 2 scripts:

reportrt.php Internal real-time reporting from the OSTicket database. Used to help manage and report tickets internally and prepair the managerial report. It reports on all tickets.

report.php Managerial report for last month. It contains less information than the internal report, plus tickets from the current month are excluded. So, to generate a managerial report for August, the report is generated in September.

The last comment/post in a ticket is what appears in the "Last Comment" column. The process adopted was for staff to review open tickets at the end of the month (or early in the next month), and post an internal 1 line progress comment for the report (a convention was adopted to suffix the comment with '(eom)' as seen in the the screen shot).

Setup

  • The code is contained in the reports directory. This directory needs to be uploaded to your web server and made accessable via a URL.
  • Edit report.inc.php to setup database connection details.
  • Import the SQL in viewsCreate.sql into your OSTicket database. The PHP scripts use these views. Note that the SQL assumes an ost_ prefix on tables. Edit the SQL to match your deployment.
  • You can add your own SQL to the report.php, etc scripts to suite your needs.

Using

Ticket #hashtags

Process #hashtags in ticket notes/comments.

The script hashtag/processTags.php processes the last thread entry for open tickets and looks for hashtags, eg "#WOC" (WOC = Wait On Client).

Typically you would call this script from CRON:

* * * * * php /path-to-script/processTags.php > /dev/null

processTags.php then looks for an external PHP file to process the ticket. Eg, tag-WOC.php

In the hasthag folder there are some example processing scripts:

  • tag-WOC.php update a custom OSTicket Field "TicketStatus" to read "Wait On Client".
  • tag-NORMAL.php update a custom OSTicket Field "TicketStatus" to be null.
  • tag-STATUS.php update a custom OSTicket Field "TicketStatus" to arbitrary text.
  • tag-SUBJECT.php update the ticket subject.

Here is tag-STATUS.php in action

tag-STATUS.php uses a custom ticket field called "Ticket Status", set up like this in osTicket:

1 User posts a note with #STATUS and text to a ticket.

2 After note added

3 Moments later (when processTags.php called by CRON)

4 Ticket List (this is a customisation to show Ticket Status on the ticket list)

Note: tag-SUBJECT.php works similarly, excepts it updates the ticket subject field, which is a core osTicket field, not a custom field.

Setup

  • Update the variable $settings in processTags.php with your database settings.
  • processTags.php needs a custom view called "tickets_last_entry". The SQL to create this view is contained in the file reports/viewsCreate.sql

About

Extensions and Scripts to complement OSTicket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published