On Jun 24, 9:41 pm, Lukasz Szybalski <[email protected]> wrote:
> Hello,
> I have a list of ticket that I want to close.
>
> How can I do this via xmlrpc?
>
>  server = 
> xmlrpclib.ServerProxy("http://user:[email protected]/trac/login/xmlrpc";)
>
> I can query the ticket I want:
> for i in 
> server.ticket.query("milestone=Upload&version=IL&status=new&custom_number=XX11000239"):
>     server.ticket.get(i[0])
>
> How do I set the "status=closed" "resolution=fixed" and add a comment
> "closing this ticket per xyz".

1. You need to call ticket.getActions() to see available actions for
the ticket in current state and for current permissions. See a
functional test for what this call and result looks like:
http://trac-hacks.org/browser/xmlrpcplugin/trunk/tracrpc/tests/ticket.py#L29

2. You use the action + supplementary fields as part of the attributes
when updating tickets. Have a look at a functional test for a simple
action-based update (reassign in this example):
http://trac-hacks.org/browser/xmlrpcplugin/trunk/tracrpc/tests/ticket.py#L276

Note that when doing updates, you should ALWAYS include 'action' -
even if the action is just 'leave'. Also, you should include the
timestamp from ticket.get() when updating so that updates perform
collision detection and don't overwrite based on stale information. As
the current update() docs say: "Calling update without 'action' and
'_ts' changetime token is deprecated, and will raise errors in a
future version."



:::simon

https://www.coderesort.com
http://trac-hacks.org/wiki/osimons

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

Reply via email to