Hi everybody,
I'm trying to extract the worktime consumed per ressource and per project through this SQL code below, and it works fine.
SELECT r.`fullname`, p.`name`, year(workDate), month(workDate), SUM(w.`work`)
FROM `project` p
JOIN `work` w
ON w.`idProject`= p.`id`
JOIN `resource` r
ON r.`id` = w.`idResource`
WHERE w.`workDate` BETWEEN '2019/01/01' AND '2019/03/31'*/
GROUP BY year(workDate), month(workDate), p.`name`, r.`fullname`
Now what I wish to do, is determine the worktime consumed per activity. The problem is, I couldn't find a link between both tables: activity and work. It's as if the activities in the imputation menu are only for visual purposes, the imputed worktime is actually linked to the whole project, not it's activities.
Thanks in advance for your help.
link is through refType='Activity' and refId=(id of the activity).
Note that you can have some work on tickets with refType='Ticket' and refId=(id of ticket)