When updating a ticket, all you have to do is pass whatever _ts
value you get from the server. The timestamp is a marker for the server to make sure that updates are performed based on latest values, and not on stale values. So, in order to do ticket.update
you first have to do ticket.get
.
What this value is exactly has changed with Trac. In earlier Trac versions (pre-0.12) timestamped based on seconds since epoch. However, with 0.12 this changed so that Trac now timestamps based on microseconds. So dividing by 1.000.000 will get you the seconds since epoch. The plugin works with both versions.
However, all this is implementation details you should not be concerned with. _ts
is really just a token used to ensure valid updates.
As for available fields, that also depends on your server. If you have defined custom fields they will also appear as available fields for creation and updating. All fields are returned by the ticket.getTicketFields
call. However, as you noticed, the plugin does not know anything about types, expected inputs, validation rules or similar. You may even have validation/manipulator plugins installed the plugin cannot know about. The plugin takes the data as if entered through web, and makes Trac perform validation of input - applying changes if all is correct, or returning all the warnings if problems are found. With fields as if entered through web, all ticket attributes should be passed as plain strings.
If you have specific suggestions for more correct documentation, then by all means add patch or suggestions to this ticket.