Opened 9 years ago

Closed 9 years ago

#5268 closed defect (fixed)

ticket.status.delete() and ticket.status.update() are broken

Reported by: Thijs Triemstra Owned by: osimons
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Thijs Triemstra Trac Release: 0.11


Consider the following code:

# get existing statuses from trac
statuses = self.proxy.ticket.status.getAll()
# remove existing statuses from trac if necessary
if len(statuses) > 0:
    for status in statuses:

This prints the following error on my client:

['accepted', 'assigned', 'closed', 'new', 'reopened']
2009-05-22 07:06:33,768 - A fault occurred!
2009-05-22 07:06:33,773 - Fault code: 2
2009-05-22 07:06:33,773 - Fault string: '__init__() takes exactly 2 arguments (3 given)' while executing 'ticket.status.delete()'

And Trac 0.11.4 throws this error:

07:06:33 Trac[web_ui] ERROR: __init__() takes exactly 2 arguments (3 given)
07:06:33 Trac[web_ui] ERROR: Traceback (most recent call last):
  File "/Users/thijstriemstra/jira2trac/test/plugins/tracrpc/tracrpc/", line 60, in process_request
    result = XMLRPCSystem(self.env).get_method(method)(req, args)
  File "/Users/thijstriemstra/Sites/jira2trac/test/plugins/tracrpc/tracrpc/", line 85, in __call__
    result = self.callable(req, *args)
  File "/Users/thijstriemstra/Sites/jira2trac/test/plugins/tracrpc/tracrpc/", line 260, in delete
    cls(self.env, name).delete()
TypeError: __init__() takes exactly 2 arguments (3 given)

Attachments (0)

Change History (4)

comment:1 Changed 9 years ago by Thijs Triemstra

Summary: __init__() takes exactly 2 arguments (3 given) while executing 'ticket.status.delete()'ticket.status.delete() and ticket.status.update() are broken

I'm having the same problem with ticket.status.update() now, so renaming the ticket.

comment:2 Changed 9 years ago by osimons

Owner: changed from Alec Thomas to osimons

With Trac 0.11, 'status' is something that is provided by the active workflow. Changing it through xmlrpc no longer makes sense, and 'status' in enum table is no longer used (nor does Trac provide an Admin page to update them).

I think all 'ticket.status' methods need to be removed from the XmlRpcPlugin in trunk.

comment:3 Changed 9 years ago by osimons

Actually, ticket.getAvailableActions(ticket_id) is of somewhat limited use as it only provides read access to possible ticket actions without saying what that implies for field changes. Examples:

  • 'resolve' should require a 'resolution' on update with 'status' implied by action
  • 'reassign' should require new 'owner' and again 'status' implied by action

I suppose until there is better workflow support in the XmlRpcPlugin, we should leave status.get() and status.getAll() and just allow updating fields directly as we do now (bypassing workflow). However, the other status methods should really be removed (create, update, delete).

comment:4 Changed 9 years ago by osimons

Resolution: fixed
Status: newclosed

Fixed as part of [6045].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain osimons.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.