Hey there,

i recently upgraded our osticket installation to V1.15.1 and was wondering how i can schedule csv-exports via cron (shell script). I read some discussions were this should be possible but i cannot find any documentation or examples how i can do that.

We migrated recently from spiceworks to osTicket and we would need (for long term usage) a scheduled export of all Tickets (every month) saved as a .csv-file so our controlling department can calculate internal cost centers, which are documented according to the time spent on the tickets.

Would be nice if anybody could help me with that.

For now our workaround ist exporting this csv manually.

Thank you in advance!

Edit:

Maybe there is a feature in osTicket itself where you can schedule exports of certain contents like uickets, agents, users etc. to send this via e-mail or write to a shared folder.

You would write a script that creates your report (in whatever language you want) pulling whatever data you want from the DB. Then you would use a scheduler (like cron) to run the script at an interval of your choosing.

7 days later

Thank you for your reply. But how do i set up the script? What command do i have to use to pull the data from osTicket? Thats my problem actually!

An example would help me a lot.

You would pick a scripting language, learn how to do MySQL/MariaDB SQL queries using that language, and then familiarize yourself with the database structure of osTicket to be able to pull the data that you are looking for.

So i have to this directly via an SQL-script? I can not use a simple bash-script which calls a webfunction to osTicket and exports certain tickets to csv? As i can export tickets via the webgui without any problem, this is not possible to do with a script which is calling for example "osticket-export.php -export -format=csv -parameter-for-tickets" or so?

If you can write a webfunction that logs in and runs the export commands you could probably do that. But since Agent accounts access controls what tickets an Agent can see you would not get a complete view of all the tickets if your account didn't have access to absolutely everything and would be better off exporting it at the SQL level.

12 days later

Okay, thank you for that information. I may thought of creating a "report agent" which has access to all tickets in read-only and export them with that credentials.
But this all seems kinda meh to me...
I will check for some SQL-export stuff and will propably do that.

Thank you!

Write a Reply...