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

Advanced Search - Customize exported fields?

I have searched the forum a bit, but have not really found the information I am looking for. Every week, my supervisor needs a detailed report on the events that happened the week prior. I like the export feature, but there are some additional fields I would like to be added during the export to .csv. Ive poked around in the database, and browsed through the code a little bit, but cant seem to find where this gets called.

Any insight will be great!

Comments

  • MrJosh;39148 said:
    I have searched the forum a bit, but have not really found the information I am looking for. Every week, my supervisor needs a detailed report on the events that happened the week prior. I like the export feature, but there are some additional fields I would like to be added during the export to .csv. Ive poked around in the database, and browsed through the code a little bit, but cant seem to find where this gets called.

    Any insight will be great!
    What fields you are trying to search?

    Look at scp/tickets.inc.php that's where the table is defined with all fields, you can add more fields in table and when you export, they will show on your report.

    Cheers
  • I am looking to add the priority, description, and possibly the date completed fields. Also, I see a tickets.php but not tickets.inc.php....

    Thanks.
  • tickets.inc.php looks like its in the /include folder... ;)
  • I haven't Find the tickets.inc.php .kindly help me in this . i am using v1.7

    @rishidawar:

    hello
    i am using 1.7 osticket . And i need to increase the no. of field in the export csv file as requirement. Kindly help me regarding this .

    Thank you
  • @rishidawar:

    hello
    i am using 1.7 osticket . And i need to increase the no. of fields in the export csv file as requirement. Kindly help me regarding this .

    Thank you
  • Have you resolve this issue?
  • Re: Customize exported fields?

    No, i couldn't resolve this problem . But I had Created new export option which picks the tickets directly from data base by running the query. This is alternate of above but i am trying to resolve above also.
  • pradhmanyu;43133 said:
    No, i couldn't resolve this problem . But I had Created new export option which picks the tickets directly from data base by running the query. This is alternate of above but i am trying to resolve above also.
    hello, was able to solve the problem?
  • How can I add threads in the export

    Will someone help me with adding the threads in the export to csv.
    I found the file /include/class.export.php with the next fields.
    Can I add threads here also?
    Tried some things but did not succeed.
    File:
    # XXX: Think about facilitated exporting. For instance, we might have a
    # TicketExporter, which will know how to formulate or lookup a
    # format query (SQL), and cooperate with the output process to add
    # extra (recursive) information. In this funciton, the top-level
    # SQL is exported, but for something like tickets, we will need to
    # export attached messages, reponses, and notes, as well as
    # attachments associated with each, ...
    /* static */ function dumpTickets($sql, $how='csv') {
    return self::dumpQuery($sql,
    array(
    'ticketID' => __('Ticket Id'),
    'created' => __('Date'),
    'subject' => __('Subject'),
    'name' => __('From'),
    'priority_desc' => __('Priority'),
    'dept_name' => __('Department'),
    'helptopic' => __('Help Topic'),
    'source' => __('Source'),
    'status' => __('Current Status')
    ),
  • porsche924;43620 said:
    Will someone help me with adding the threads in the export to csv.
    I found the file /include/class.export.php with the next fields.
    Can I add threads here also?
    Tried some things but did not succeed.
    File:
    # XXX: Think about facilitated exporting. For instance, we might have a
    # TicketExporter, which will know how to formulate or lookup a
    # format query (SQL), and cooperate with the output process to add
    # extra (recursive) information. In this funciton, the top-level
    # SQL is exported, but for something like tickets, we will need to
    # export attached messages, reponses, and notes, as well as
    # attachments associated with each, ...
    /* static */ function dumpTickets($sql, $how='csv') {
    return self::dumpQuery($sql,
    array(
    'ticketID' => __('Ticket Id'),
    'created' => __('Date'),
    'subject' => __('Subject'),
    'name' => __('From'),
    'priority_desc' => __('Priority'),
    'dept_name' => __('Department'),
    'helptopic' => __('Help Topic'),
    'source' => __('Source'),
    'status' => __('Current Status')
    ),


    Hello, I also modify the file you mention but not get succeed, what I did was something different, I could create a BAT file in order to export all fields of the table "ost_ticket", put the code and also enclose the file so that you can view and modify to your liking, if you have any questions you comment me.

    File BAT: EXPORTS THE FIELDS OF A PARTICULAR DAY

    REM DESHABILITANDO ECO
    @ECHO OFF
    CLS
    ECHO.
    set anio=%date:~6,4%
    set mes=%date:~3,2%
    set dia=%date:~0,2%
    set hora=%time:~0,2%
    set hora=%hora: =0%
    set minuto=%time:~3,2%
    set segundo=%time:~6,2%
    CLS
    ECHO ***** INGRESANDO FECHA *****
    ECHO POR FAVOR UTILIZAR EL SIGUIENTE FORMATO DE FECHA
    ECHO AÑO YYYY
    ECHO MES MM
    ECHO DIA DD
    SET /P ANO2=INGRESE AÑO DE INICIO:
    SET /P MES2=INGRESE MES DE INICIO:
    SET /P DIA2=INGRESE DIA DE INICIO:
    ECHO.

    cd C:\xampp\mysql\bin "here has to be the path where is hosted the osticket"
    ECHO.
    mysql -h localhost -u root -p -D osticket (-D osticket this is the name of my DATABASE) -e "SELECT * FROM `ost_ticket` WHERE year(`created`)=%ANO2% and month(`created`)=%MES2% and day(`created`)=%DIA2% INTO OUTFILE 'C:/Users/Administrador/Desktop/REPORTES/reporte.csv' (put the path where you want to save the exported file) FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n';"

    cd C:\Users\Administrador\Desktop\REPORTES (put the path where you saved the exported file)
    ren reporte.csv reporte_%dia%-%mes%-%anio%_%hora%-%minuto%_%segundo%.csv

    What this green are comments I posted for you to understand what needs to change.
    BAT file comments that are red are in Spanish because it is my native language, these comments all may see when running the BAT file and should not be deleted, I will be attentive to your comments.
    ejecutardia.zip
    669B
  • Thank you very much.
    I use Linux for hosting osticket, but I can convert your bat-file to linux later.
    This helps, but most beatifull is stil a button in the GUI.
    Thanx again!
  • porsche924;43630 said:
    Thank you very much.
    I use Linux for hosting osticket, but I can convert your bat-file to linux later.
    This helps, but most beatifull is stil a button in the GUI.
    Thanx again!


    no problem
  • pradhmanyu;41421 said:
    @rishidawar:

    hello ,

    i solved this problum.
    i am using 1.7 osticket . And i need to increase the no. of fields in the export csv file as requirement. Kindly help me regarding this .

    Thank you
    Add required Field in class.export at line no 45 as:

    'i_date' => 'I date'

    than add the column name of the field from database to the $qselect Query
    at line no. 255 in the include/staff/tickets.inc.


    After these two steps, the extra field is added in the export file.
  • edited March 2015
    I tried to follow the directions above with very little success.  It may be because they are so old.
    I figured out where to add:

    'close_date'     => __('Closed Time') in the class.export.php file, but I don't see where to add the second part to make it all work.  As a side note, I am not sure 'close_date' is the proper syntax.
     
    My goal is to get the closed date/time into the report that exports for closed tickets. 

    Thank you very much for any help.
    I am running version 1.9.6

    --David

  • Yep, same, i want to know how to custom these fields, and in the tickets.inc there is no $qselect query
  • This thread is for 1.7 and from May 2013.
    I find it unlikely that you will receive a response.
  • hi @porsche924,

    Were you able to convert the BAT file in linux and does it solve the problem?

    I am also using Linux 14.04 in my osticket 1.9.15
  • I want to include the custom field forms in the exported file
  • closing zombie thread with a head shot.
    Please do not be a necromancer.
This discussion has been closed.