from trac.ticket.model import Ticket # create a new ticket t = Ticket(env) t['summary'] = 'Example ticket' t['description'] = 'This is a sample ticket created with the Trac API' t.insert()
from trac.ticket.model import Ticket # load an existing ticket ticket_id = 123 t = Ticket(env, ticket_id) # update the owner of the ticket t['owner'] = 'johndoe' t.save_changes('updated owner')This example loads an existing ticket by ID and updates the owner, then saves the changes with a comment. The package library for the trac.ticket.model Ticket class is Trac itself.