Adding a project column to custom reports
|Reported by:||endquote||Owned by:||falkb|
I wanted to modify some of the default reports such as "my tickets" to include a
project column. To do that I simply added an additional select:
( SELECT smp_project.name FROM smp_project, smp_component_project, smp_milestone_project WHERE (t.milestone = smp_milestone_project.milestone AND smp_milestone_project.id_project = smp_project.id_project) OR (t.component = smp_component_project.component AND smp_component_project.id_project = smp_project.id_project) LIMIT 1 ) AS project
This works, but it's probably not very efficient. But there is another problem...
I then created a new project, but didn't create any components or milestones for it. Then created a ticket for that project. Of course the above selection doesn't return anything in that case. However if I do a custom query with
project is myproject, the ticket comes up correctly.
So my question is how a project gets associated with a ticket, if not via the component/milestone tables.