查询Trac以获取与用户相关的所有票证

发布于 2024-07-21 12:28:55 字数 53 浏览 5 评论 0原文

如何查询与用户相关的所有 trac 票证。 即曾经分配过、现在分配过、创建过等等的所有票证

How do I query for all trac tickets related to a user. i.e. all tickets for which the tickets were once assigned, assigned now, created , etc etc

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奢望 2024-07-28 12:28:55

创建对 ticket_change 表的自定义查询。 需要一些 SQL。 对于一次/现在分配,查找 field='owner'newvalue 列包含票证分配给的用户名的行。 对于创建的工单,只需在ticket表中通过reporter查询即可。

例子:

SELECT p.value AS __color__,
   id AS ticket, summary, component, version, milestone,
   t.type AS type, priority, t.time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter
  FROM ticket t, enum p, ticket_change c
  WHERE p.name = t.priority AND p.type = 'priority'
  AND c.field = 'owner'
  AND c.newvalue = '$USER'
  AND c.ticket = t.id
  ORDER BY p.value, milestone, t.type, t.time

Create custom queries to the ticket_change table. Some SQL required. For assigned once/now, look for rows where field='owner', newvalue column contains the user name the ticket was assigned to. For created tickets, just query by reporter in the ticket table.

Example:

SELECT p.value AS __color__,
   id AS ticket, summary, component, version, milestone,
   t.type AS type, priority, t.time AS created,
   changetime AS _changetime, description AS _description,
   reporter AS _reporter
  FROM ticket t, enum p, ticket_change c
  WHERE p.name = t.priority AND p.type = 'priority'
  AND c.field = 'owner'
  AND c.newvalue = '$USER'
  AND c.ticket = t.id
  ORDER BY p.value, milestone, t.type, t.time
人│生佛魔见 2024-07-28 12:28:55

您可以使用 TraqQuery 表达式 来表达这一点。 例如,如果您希望显示 id、摘要和状态列并查询当前登录用户 ($USER) 的所有票证,请使用以下查询。

query:?col=id
&
col=summary
&
col=status
&
owner=$USER

但是,此查询假设所有者在票证的生命周期内不相同(因为所有权可以更改)。

如果您想要特定用户,请将 $USER 替换为实际用户名。 此外,如果您使用 Agilo 插件,您可以轻松地在通过网络用户界面飞行。 这是通过查看报告并向报告添加过滤器来完成的。

You can express this with a TraqQuery expression. E.g. if you want the columns id, summary and status to show up and query all the tickets for the currently logged in user ($USER) then use the following query.

query:?col=id
&
col=summary
&
col=status
&
owner=$USER

However this query assumes that the owner hasn't been the same during the lifetime of a ticket (since ownership can be changed).

If you want a specific user then replace $USER with the actual username. Also if you're using the Agilo plugin you can easily create new queries on the fly via the web-UI. This is done by looking at a report and adding filters to the report.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文