如何修改trac的assign to下拉列表

trac ticket的assign to下拉列表中的名单,没有保存在配置文件里头。读一下TracFaq有下面发现:

This will change the Assign To ticket filed into a select box that only contains existing users. However as it says on the TracTickets page, the user must have logged, in at least once, and set their email address.

If you run multiple Trac sites, and have a set of common users across all Trac sites, it gets annoying to have to log into each one and set the email.

So, what is one to do? Well, there are two things that need to be entered into the database: a session record, and an email record.

所以我们只需要对trac的session表做操作就可以修改assign to的下拉菜单列表。session的表结构如下:

Table "session" 
Column         | Type    | Modifiers 
sid            | text    | not null 
authenticated  | integer | not null 
last_visit     | integer | 


缺省配置下,trac ticket的状态和bugzilla的bug状态不一样,只有new,fixed,invalid,wontfix,duplicate,worksforme这几种。在trac 0.11之后,可以自己定义workflow,只需要将trac.ini的[ticket-workflow]章节修改一下,就可以支持verify状态:

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

2 replies on “trac使用经验两则”

不错。在svn commit时写注释写上ticket号,能自动在trac系统相关的ticket上显示本次svn代码修改情况吗?

Leave a Reply

Your email address will not be published.