Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7994 closed task (worksforme)

how to set and action (for workflow) via xmlrpc

Reported by: sanjay Owned by: osimons
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: olemis Trac Release: 0.11

Description (last modified by osimons)


I cannot figure out how to change the ticket status (e.g. reassign to someone) via xmlrpc.

I am trying to use:
array ticket.update(int id, string comment, struct attributes={}, boolean notify=False)

the api says:
Update a ticket, returning the new ticket in the same form as getTicket(). Requires a valid 'action' in attributes to support workflow.

what should the attributes structure look like exactly? I assume a valid action would mean 'reassign'. But I cant figure out how I need to pass the parameters into the api.
I hope someone can help!

I am usinc xmlrpc via c# and have a standard workflow.

accept = new,assigned,accepted,reopened -> accepted
accept.operations = set_owner_to_self
accept.permissions = TICKET_MODIFY
leave = * -> *
leave.default = 1
leave.operations = leave_status
reassign = new,assigned,accepted,reopened -> assigned
reassign.operations = set_owner
reassign.permissions = TICKET_MODIFY
reopen = closed -> reopened
reopen.operations = del_resolution
reopen.permissions = TICKET_CREATE
resolve = new,assigned,accepted,reopened -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by osimons

  • Description modified (diff)
  • Resolution set to worksforme
  • Status changed from new to closed

Mailing list would be better for "support" issues...

Anyway, the basic idea is:

  1. Use ticket.getActions(int id) to get all available actions for the ticket. The documentation for this command says: "Returns the actions that can be performed on the ticket as a list of [action, label, hints, [input_fields]] elements, where input_fields is a list of [name, value, [options]] for any required action inputs.". It will return the actions allowed by the user on the ticket in current state, and with any additional fields - like the web form does.
  2. To attributes you add 'action', for instance 'reassign'. But, as from 1. above you would see that reassigning includes a separate input field, that field must also be added. So, the minimum attributes posted would need to be {'action': 'reassign', 'action_reassign_reassign_owner': 'osimons'}.


comment:2 Changed 4 years ago by sanjay

thanks very much indeed!

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.