Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Append a created "Ticket Status" form field to an already existing column in the main ticket view


I recently made a change to my ticket form and I had a question.  If you look at the attached screenshot, you can see that I added a new field via the Admin Panel -> Manage -> Forms -> Ticket Details.  This field is a "Status" field that can be set when a ticket is created, and it will signify the progress that is being made with the ticket.  I have options such as, "Opened",  "Work in Progress", "Awaiting Feedback", "Ready for Deployment", etc.  This field can also be edited throughout the ticket completion progress to give a more detailed description of the ticket status.

Here comes the task I want to accomplish.  I've added some columns to the main ticket window so I am somewhat familiar with how this is done.  What I was curious about was how I can append the status of the ticket to an already created column in the main ticket view window so that it can be easily seen.

When a new form field is created, such as the status field, does this get saved as a variable somewhere?  I need to be able to access this variable so that I can put it in the <TD> of a column for it to be displayed but I am unsure of what variable to reference to do this.  If anyone has any ideas about how to reference this newly created status variable, it would be greatly appreciated.  Also, if any further clarification is needed please feel free to ask.

I appreciate the help!




  • I've been searching through the database to locate where that variable would be stored but I have had no luck so far
  • edited November 2014
    It is currently not possible thru the UI. But the developers plan to implement this in a future version of osTicket as "custom queues".

    Btw: When you upgrade to 1.9.4 you can easily define your own statuses under Admin Panel -> Manage -> Lists -> Ticket Statuses. Since you tagged your post 1.9.2. I guess your not using 1.9.4 yet ;)

    If you like to modify the main ticket view page yourself, the following discussion may helps:
  • I'm also wondering if anyone would know how to modify my qselect and qfrom statements to pull that data.
    I'm pretty sure what I am looking for is in the ost_form_field table with a name of progress.  I am just not sure how to call this in my select and from statements.
  • Actually I believe I can access this through the table ost_ticket__cdata.  Its just setting up my qselect and qfrom statement that I am having trouble with.  Basically I just want to get access to the value in "progress" for that particular ticket and add it to an already existing column.
  • I figured it out guys, somewhere around line 235 there is the following qselect statement (sorry for the bad formatting as I copied and pasted from vi:

    //ADD attachment,priorities, lock and other crap
    $qselect.=' ,IF(ticket.duedate IS NULL,IF( IS NULL, NULL, DATE_ADD(ticket.created, INTERVAL sla.grace_period HOUR)), ticket.duedate) as duedate '
    .' ,CAST(GREATEST(IFNULL(ticket.lastmessage, 0), IFNULL(ticket.closed, 0), IFNULL(ticket.reopened, 0), ticket.created) as datetime) as effective_date '
    .' ,CONCAT_WS(" ", staff.firstname, staff.lastname) as staff, as team '
    .' ,IF(staff.staff_id IS NULL,,CONCAT_WS(" ", staff.lastname, staff.firstname)) as assigned '
    .' ,IF(ptopic.topic_pid IS NULL, topic.topic, CONCAT_WS(" / ", ptopic.topic, topic.topic)) as helptopic '
    .' ,cdata.priority_id, cdata.progress as ticket_prog, cdata.subject, cdata.organization as ticket_org,       pri.priority_desc, pri.priority_color';

    There is already a handle to the cdata table so I simply added the portion of code highlighted in yellow, then echoed ticket_prog in the appropriate <TD> and I was able to show the ticket status on the main ticket view page.

    I appreciate the input @Chefkeks!
Sign In or Register to comment.