On Fri, Aug 7, 2009 at 4:29 AM, Rehan<a.rehan...@gmail.com> wrote:
>
> Hello,
>
> I want to export csv file with all the custom fields that I've added
> to the trac.ini file.
>
> The problem is that I want to export tickets that I have selected
> through 'Custom Query' (in 'View Tickets'). However, the export link
> at the bottom of the page do not export all the fields and especially
> the custom fields. I've found that the query function display only the
> first seven columns so I have removed this contraint in the file
> query.py, def get_default_columns (line 185). I've changed << cols =
> all_cols[:7] >> to << cols = all_cols >>.
>

Suggestion :

- Install TracGViz plugin [1]_ [2]_.
- Setup data sources [3]_ for ticket data [4]_ (enabling'em).
- Access a URL like the one shown below to retrieve ticket
  data (including custom fields ;o) in CSV format

{{{
http://<server>/path/to/env/gviz/ticket/list?id=<id1>&id=<id2>&...&tqx=out:csv
}}}

e.g. in a test env (without custom fields, but they should be there if
installed ;o) few minutes ago I got

{{{
Cc,Component,created,Description,id,Keywords,Milestone,modified,Owner,Priority,Reporter,Resolution,Status,Summary,Type,Version
'','component1',2009-08-10 14:21:42,'Shake it up !',1,'oh yea
!','milestone2',2009-08-10
14:21:42,'somebody','major','olemis','','new','The ticket','defect',''
}}}

- Access a URL like the one shown below to retrieve custom
  ticket fields available in your environment (including custom
  fields ;o) in CSV format.

{{{
http://<server>/path/to/env/gviz/ticket/fields?tqx=out:csv
}}}

on accessing http://localhost/trac/newprj/gviz/ticket/fields?tqx=out:csv
few minutes ago, I got :

{{{
label,name,optional,options,type,value
'Summary','summary',,,'text',
'Reporter','reporter',,,'text',
'Owner','owner',,,'text',
'Description','description',,,'textarea',
'Type','type',,"['defect', 'enhancement', 'task']",'select','defect'
'Status','status',true,"['accepted', 'assigned', 'closed', 'new',
'reopened']",'radio',''
'Priority','priority',,"['blocker', 'critical', 'major', 'minor',
'trivial']",'select','major'
'Milestone','milestone',true,"['milestone1', 'milestone2',
'milestone3', 'milestone4']",'select',''
'Component','component',,"['component1', 'component2']",'select',''
'Version','version',true,"['2.0', '1.0']",'select',''
'Resolution','resolution',true,"['fixed', 'invalid', 'wontfix',
'duplicate', 'worksforme']",'radio','fixed'
'Keywords','keywords',,,'text',
'Cc','cc',,,'text',
}}}

AFAIK there are no limits on the number of columns returned.

You can also use

- tqx=out:html     rendered as HTML instead of CSV
- tqx=out:json     JSON data instead of CSV
- tqx=out:moin    data in Trac MoinMoin wiki format instead of CSV

There are many other data sources offering further data that can be
downloaded in all those formats too.

Hope this can help you !

PS: If you find out that there's something wrong, pls submit a ticket
[5]_ and include details about the specific problem :

.. [1] TracGViz plugin
        (https://opensvn.csie.org/traccgi/swlcu/wiki/En/Devel/TracGViz)

.. [2] TrascGViz plugin - download
        (http://pypi.python.org/pypi/TracGViz)

.. [3] Trac data sources for Google Visualizations - Preconditions
        
(https://opensvn.csie.org/traccgi/swlcu/wiki/En/Devel/TracGViz/DataSources#Preconditions)

.. [4] Full Reference
        
(https://opensvn.csie.org/traccgi/swlcu/wiki/En/Devel/TracGViz/DataSources#FullReference)

.. [5] Create new ticket
        
(https://opensvn.csie.org/traccgi/swlcu/newticket?component=plugin_trac_gviz&type=defect)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to