New User: Why isn't my TicketQuery macro working?

60 views
Skip to first unread message

cornerstone

unread,
Sep 10, 2012, 10:27:17 AM9/10/12
to trac...@googlegroups.com
Hi all,
I am new to the system and need some guidance.
I added a new report with this text as the query:

[[TicketQuery(format=table,order=due_date,col=id|ticket|summary|ticket_status|priority|owner|time|modified|due_date|reporter),group=ticket_status]]

The compiler returns an error:
unrecognized token: "]"

Any idea why this isn't working?
Do I need to enable something in the configuration?

Thanks!!

Christopher Nelson

unread,
Sep 10, 2012, 11:49:50 AM9/10/12
to trac...@googlegroups.com
(Trac-Users might be a more appropriate list for this.)
I think you need to move the closing parenthesis from after "reporter"
to after "ticket_status".

[[TicketQuery(format=table,order=due_date,col=id|ticket|summary|ticket_status|priority|owner|time|modified|due_date|reporter,group=ticket_status)]]

Though I'm unsure of the use of `group` in `TicketQuery` and you may
mean "status", not "ticket_status".

cornerstone

unread,
Sep 10, 2012, 11:57:31 AM9/10/12
to trac...@googlegroups.com

Sorry everybody, made a rookie mistake.

The issue was I was forgetting the "new query:" starter. Now, it seems the table syntax is just ignoring the columns I specify.

Any idea why that might happen?

For instance,

If I do..

New query:

[[TicketQuery(format=table,col=id)]]

Shouldn’t that just return a list of all Ids? Instead I am getting the default column names no matter what I specify.

Thanks in advance!

Steffen Hoffmann

unread,
Sep 10, 2012, 2:01:59 PM9/10/12
to trac...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10.09.2012 17:57, cornerstone wrote:
> [[TicketQuery(format=table,col=id)]]
>
> Shouldn�t that just return a list of all Ids? Instead I am getting the
> default column names no matter what I specify.

Yes, and it works exactly like that for me here.
I there something in your trac.ini, especially in the [query] section?

Btw, valid column names are to be found here:
http://trac.edgewall.org/wiki/TracTickets#PresetValuesforNewTickets

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBOKwsACgkQ31DJeiZFuHf7uQCgoMuuJuPrv+L8RGxKacA04mgO
RdMAn3OJvzVbFKA09mEmc7MtXVL13xXt
=0kNW
-----END PGP SIGNATURE-----

cornerstone

unread,
Sep 12, 2012, 9:22:47 AM9/12/12
to trac...@googlegroups.com
Is it possible to have a column that displays the "Last Modified" date using the TicketQuery table syntax?

Ethan Jucovy

unread,
Sep 12, 2012, 10:09:19 AM9/12/12
to trac...@googlegroups.com
On Wed, Sep 12, 2012 at 9:22 AM, cornerstone <sptf...@gmail.com> wrote:
Is it possible to have a column that displays the "Last Modified" date using the TicketQuery table syntax?

Sure -- the column is called "modified": [[TicketQuery(format=table, col=id|modified)]]

"created" is also available.

cornerstone

unread,
Sep 13, 2012, 10:55:00 AM9/13/12
to trac...@googlegroups.com
Here is my query:
query:
[[TicketQuery(format=table, col=id|modified)]]

The columns I get returned are:
Ticket   Summary   Owner   Status  Priority   Resolution   Created


Here is the contents of my trac.ini file under [query]:
[query]
default_anonymous_query = status!=closed&cc~=$USER
default_query = status!=closed&owner=$USER
items_per_page = 100
ticketlink_query = ?status=!closed



Any idea why my query isn't returning just the ticked id and date modified?
No matter what columns I specify, I get the same query result. It seems to be ignoring my parameters.
Thanks in advance!

-Sean

Steffen Hoffmann

unread,
Sep 13, 2012, 6:18:53 PM9/13/12
to trac...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13.09.2012 16:55, cornerstone wrote:
> Any idea why my query isn't returning just the ticked id and date modified?

Not without seeing DEBUG logging of a GET request for a wiki page
containing the macro in question with SQL debugging by setting

[trac]
debug_sql = True

Any chance, that you have Trac plugins installed? If so, you may wish to
disable all and re-enable one by one. Wouldn't be the first case of a
not-so-mysterious code interference discovery.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBSW8oACgkQ31DJeiZFuHdc/gCeInk9ncWX3Ib83kaO7fI4U/4A
X+cAoL8B9ozZLMQbzsVnjVfFzvdTrUKZ
=J2Jr
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages