bloodhound-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ollos <ryan.ol...@wandisco.com>
Subject Re: xmlrpc ticket.query or report.execute complex query
Date Thu, 20 Mar 2014 17:45:00 GMT
On Thu, Mar 20, 2014 at 10:17 AM, Mark Abbate <abbatemp@gmail.com> wrote:

> Hi All
>
> I would like to query for tickets over xmlrpc, but the query needs to have
> multiple parts.
>
> The ticket.query works with one part. It wasn't clear to me if
> ticket.query supports multiple parts using the trac query language syntax.
>
> I tried
> <param><string>owner=mabbate&product=mercer</string></param>
>
> but I get this:
> ProtocolException: ProtocolException details : <Fault -32700: u'not
> well-formed (invalid token): line 4, column 38'>
>
> It does look like I can create and then execute a report on the fly.
>
> Can ticket.query handle multiple parts? If not, do I need to create and
> execute a report, or are there other ways to make complex queries.
>
> thanks!
> Mark Abbate
>

The following works for me, so I think XmlRpcPlugin supports multiple
parameters in the Query.

I guess maybe you need to escape the "&" in the XML?

#!/usr/bin/env python
import xmlrpclib

if __name__ == '__main__':
    server = xmlrpclib.ServerProxy("http://trac-hacks.org/xmlrpc")

    multicall = xmlrpclib.MultiCall(server)
    count = 0
    for ticket in
server.ticket.query("owner=rjollos&component=PlantUmlMacro&status!=closed"):
        multicall.ticket.get(ticket)
        count += 1
    print map(str, multicall())
    print "Queried returned ", count, " tickets."

Mime
View raw message