Re: [Trac] Ticket Status Table

2017-09-10 Thread Chris Shelton
This is very specific to our list of components and statuses, and relies on
the WikiTableMacro plugin from https://trac-hacks.org/wiki/WikiTableMacro,
but I wrote a query a few years ago that is close to what you are looking
for, I think.  This may have some MySQL specific syntax, but should be
close enough to be helpful.

{{{
#!SQLTable
select
  s.component as Functional_Area,
  concat('[query:?status=new=', replace(s.component, ' ', '+'),
' ', s.new, ']' ) as New,
  concat('[query:?status=assigned=', replace(s.component, ' ',
'+'),
' ', s.assigned, ']' ) as Assigned,
  concat('[query:?status=in_work=', replace(s.component, ' ',
'+'),
' ', s.in_work, ']' ) as In_Work,
  concat('[query:?status=in_QA=', replace(s.component, ' ', '+'),
' ', s.in_QA, ']' ) as In_QA,
  concat('[query:?status=info_needed=', replace(s.component, ' ',
'+'),
' ', s.info_needed, ']' ) as Info_Needed,
  concat('[query:?status=resolved=', replace(s.component, ' ',
'+'),
' ', s.resolved, ']' ) as Resolved,
  concat('[query:?status=closed=', replace(s.component, ' ', '+'),
' ', s.closed, ']' ) as Closed,
  concat('[query:?component=', replace(s.component, ' ', '+'),
' ', s.total, ']' ) as Total
from (
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'ar'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'auxiliary'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'bcr'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'ca'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'cm'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'gl / ld / pdp'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when status = 'in_work' then 1 end ) in_work,
   count( case when status = 'in_QA' then 1 end ) in_QA,
   count( case when status = 'info_needed' then 1 end ) info_needed,
   count( case when status = 'resolved' then 1 end ) resolved,
   count( case when status = 'closed' then 1 end ) closed,
   count(*) as total
from
   ticket
where
   component = 'pay'
UNION
select
   component,
   count( case when status = 'new' then 1 end ) new,
   count( case when status = 'assigned' then 1 end ) assigned,
   count( case when 

[Trac] Re: Comments from Git's branch can not be inserted into a task list

2017-09-10 Thread RjOllos


On Friday, September 8, 2017 at 2:00:02 AM UTC-7, Mingxing Tian wrote:
>
> I fill in the comments in the format when I submit the change:
>
> see #1695 test commit
>
> If submitted on the trunk, add a comment on the ticket (# 1695).
> But submitted on the branch, the following error occurs.
>
> Trac[web_ui] WARNING: Unable to insert changeset 
> 0837f161e858afba78318dadac512444f1bb013e/testing and ticket 1695 into db: 
> (1062, "Duplicate entry 
> 'testing-0837f161e858afba78318dadac512444f1bb013e-1695' for key 'PRIMARY'"
> )
>
> Why can not the comments submitted from the branch be automatically added 
> to the comment in the order? Is this a bug?
>

Looks like it's reported already:
https://trac-hacks.org/ticket/12966

I did some work on the plugin but I don't really have time to maintain it. 
It could use a maintainer.

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.


Re: [Trac] Ticket Status Table

2017-09-10 Thread RjOllos


On Saturday, September 9, 2017 at 12:37:09 PM UTC-7, 
ianstuartjone...@gmail.com wrote:
>
> Hi Michael,
>
> Did you ever manage to figure this out?  I'm essentially looking to build 
> a table with ticket status vs owner and have the table show ticket count.
>
> Thanks,
> Ian
>

You could try writing a report, as previously suggested, and using 
WikiReportMacro.
https://trac-hacks.org/wiki/WikiReportMacro

See TracReports for information on formatting options.
http://trac.edgewall.org/wiki/TracReports

- Ryan 

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.