I need to write a query for the osticket database that selects tickets that have been assigned to a specific user.

So if I wanted to select all the tickets that have been assigned to me (mmcgale) by anyone, what would the query be?

I am joining the results with other data for reporting so it's something I need to query the database for, not use the osticket gui.

Thanks for any assistance.

Tickets are not assigned to users.
They are Assigned to Agents and owned by users.

You can look in ost_staff for your staff_id, or you can go to the Admin panel -> Agents -> Agents and mouse over your account and see the id=number. You would use this number to see what tickets are currently assigned to you.

This query would get you all ticket numbers that are assigned to your Agent account.
SELECT number FROM ost_ticket WHERE staff_id=#

5 years later

How to assign a ticket to a agent in api format ??
Generally in osticket we use API to create a ticket
Default json body ,which is in documentation:

but no ways to assign to particular user or agent or department or team??

So kindly give way to assign the ticket to particular user or agent or department

    Write a Reply...