I want to create a form with a dropdown list of locations, a required field.We already have a database that contains a list of store locations and their associated brands that is updated as we get new locations or brands change.It would be great if we could fill that location field with a query from this database. I have the php/mysql knowledge to make the query, but have no idea how to implement it into the list or field.What is the best way to accomplish this?

I recently had to do something like this for a mod I wrote and have been using for years . The basic flow is:1. create the list (in ost admin panel, or manually, or script it) the list name is stored in ost_list. note the id.2. connect to your second DB query and get your locations.3. make 1 entry per location in ost_list_items to the list you made in 1. This will populate the list.  This will not add location information to already existing tickets.4. Go into osTicket and go to admin panel -> manage -> forms. Choose which built in form you want the data associated with. (so far most of my custom forms have gone in "Ticket Details"). Enter a label (Location), in type pick the list you made in step 1 (locations). Check the Required box. in Variable type "location".4A (optional). drag your new form field up above "Issue Summary".  This will make the drop down box appear when opening the ticket before the title subject field.5. hit save changes at the bottom of the page.This will make the drop down appear in the ticket details section of your ticket and people will pick a location when they open new tickets.

Going to give this a try, thank you!

You are very welcome. :)  Glad to help.

a year later

please could you help me, i'm trying to add a dropdown list filed to the ticket form ,that gets the data from databaseI want it to be a dynamic field like the priority  dynamic fieldi searched for the code corresponding to  priority  dynamic field but i didn't found it.the code is complex to followany help please

@[deleted] start your own thread.Killing this zombie post with a head shot.

Write a Reply...