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

Ticket reporting

We have some one that currently runs reports on our tickets to see what the most issues are and what department they are in ect.

He came to me asking if i could more easily sort the tickets then just having them by department?

Can some one create a mod for me so i can add something to each ticket. Like if it's a monitor problem we could have that option in a drop down or something and be able to pick it.

It would really help.



  • Hey,

    I did that in combination with the Reporting Panel:

    First, I customized my /staff/ and my /client/ by adding a new dropdown-field for the departments in each file.

    Then I custmized the /scp/graphs/sBar.VolContact.php from the Reporting Panel MOD by changing the sql-statements that I can see the statistic for the departments.(I don't need the "Ticket Volume by Contact Method")

    Now I can see which ticket comes from which department and how many tickets come from the different departments.

    Is that the same you want or did I missunderstand you?

  • i was looking for something that the staff can set from like a list.

    > Issues <

    That way my guy can just do a query and say. How many keyboard problems did we have from jan 1 - august 31st
  • Hey,
    as I wrote, I would do that by adding the Reporting Panel from that thread:

    After you did that, take a look at this thread:

    /staff/ AND /client/
    you ADD the following code for the dropdown-menue:

    <td align=\"left\">Issues:</td>
    <select name=\"issues\">
    <option value\"\"selected >-Please select-</option>

    After you did that it is possible to choose which issue the ticket is about and you can see it also in every ticket.

    Now you have to write the different SQL-Statements for your need. I put that in /scp/graphs/sBar.VolContact.php, because I don't need the "Ticket Volume by Contact Method". You can choose another or write a new one.

    For example:

    //Count Monitor tickets
    $sql='SELECT COUNT(*) AS cnt FROM ost_ticket
    WHERE closed LIKE \"'.$_REQUEST['month'].'-%\" AND issues = \"monitor\" AND(';
    $sql.='dept_id=\"'.$_REQUEST['dept'.$j].'\" OR ';
    $sql.='0 )';

    $result = mysql_query($sql);
    if ($myrow=mysql_fetch_array($result)){
    $datay[] .= $myrow['cnt'];
    }else{$datay[] .= 0;}

    Hope it will help!

  • we need the option on the backend because we dont want the user to be able to set the option.

    We want to set the option cause just because a monitor isnt working it may not be the monitor but the computer hardware itself.

    so while a user would select monitor it would really be a hardware issue.

    Thats why i need something in the staff area to set this.
  • Ok, than put the dropdown-menue only in /staff/

    And with this MOD:

    you can change the "Issues" field, if it would be necessary...for example if a client will write a ticket.

  • thanks i got most of it down.

    the one thing i dont know how to do is, if i select say monitor how can i have it auto update as soon as i select an option so i dont need a "submit" button for it?

    i'm working with

    <option value=\"<?=Format::htmlchars($issue->getName())?>\" id=\"issue\" /><a href=\"javascript:editTicket(<?=$id?>,'issue')\">poop</option>

    i know it's not right cause it blows up my whole page but it's a start.
  • Hm..I think, I know what you mean, but it's a little bit complicated.

    Why don't you put the following code in /staff/

    <td><input type=\"text\" name=\"issue\" size=\"30\" value=\"<?=$ticket->getIssue()?>\" id=\"issue\" /><a href=\"javascript:editTicket(<?=$id?>,'issue')\"><img src=\"../images/icons/ticket_edit.gif\" /></a></td>

    That is the easiest way.
    First you write a new ticket in which you select "Monitor".
    Later, if you see that the problem is the computer instead of the monitor, you are able to change only this field in 'computer'. This field will be updated also in the database.

    Is that ok for you?

  • boss never wants the user to have the option or see any of the info we put in for "issue"

    He also wants it to be a drop down with set options so that we wont have mis spellings or other miss matched info.

    Like if an issue is a printer problem one staff member might put "printer" while another might put "printer had no paper"

    so he wants a set list of options to choose from. :mad:


    Thank you for all your help BTW,

    - Ryan
  • since the internet is too stupid to answer my question and i not knowing on how to do this.

    How can i make a drop down that says.


    and when i select one of them have it auto populate a text field?
  • Auto-populating fields.
    webster;11002 said:
    since the internet is too stupid to answer my question and i not knowing on how to do this.

    How can i make a drop down that says.


    and when i select one of them have it auto populate a text field?
    To do something like this, you can use Javascript. I do this on my ticketing system and is rather easy.

    All these MOD's are in your /include/staff/

    1. Put your select box wherever you'd like:

    2. Put this towards the end of the and include the different values you want to auto-populate
    function autopopulateInfo(form)
    if(form.source.value == 'internet'){form.blah1.value = 'text goes here'; form.blah2.value = 'blah 2 text goes here';}
    if(form.source.value == 'computers'){form.blah1.value = 'alternate text goes here'; form.blah2.value = 'more text goes here';}

    3. Put your inputs into the code (labeled blah1 and blah2 in my example)

    As long as you have javascript enabled, it'll work.
  • michael.therrien;12633 said:
    As long as you have javascript enabled, it'll work.
    That is correct. And to state the obvious: If you do NOT have javascript enables, then it will NOT work. There are plently of users who do not have javascript enabled, and this may prevent them from using your system correctly. Something to keep in mind. Of course, if you are in a controlled corporate environment, then it is not such a big deal, as probably everyone will have it enabled.
Sign In or Register to comment.