Advertisement
LuNa2713

Сторипоинты

Jul 17th, 2024
402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.30 KB | None | 0 0
  1. SELECT
  2. DATE_FORMAT(j.created_on, '%Y-%m-%d') AS "Дата",
  3. CONCAT(u.lastname, ' ', u.firstname) AS "ФИО",
  4. COUNT(jd.id) AS "Количество задач",
  5. SUM(cv.VALUE) AS "Количество StoryPoints"
  6. FROM journal_details jd
  7. INNER JOIN journals j ON j.id = jd.journal_id
  8. INNER JOIN users u ON j.user_id = u.id
  9. INNER JOIN issues iss ON j.journalized_id = iss.id -- AND iss.tracker_id = 83
  10. INNER JOIN custom_values cv ON iss.id=cv.customized_id
  11. WHERE jd.old_value IN (1, 41, 87, 89, 103) -- старый статус "New", "Внутреннее тестирование", "Тестирование на препроде", "Тестирование на проде", "QA.Требования"
  12.   AND jd.VALUE IN (69, 88, 72, 90, 101, 15, 70) -- новый статус "На оценку", "Перенести на препрод", "Перенести на прод", "Dev.Требования", "Аналитика.Запланировано", "Запланировано", "Готово"
  13.   AND jd.prop_key = 'status_id' -- изменение со статусом
  14.   AND u.id IN (1536, 2306, 2433) -- QA Романова, Тюренкова и Сухорукова
  15.   AND cv.custom_field_id = (SELECT id FROM custom_fields cf WHERE name='Изначально StoryPoints')
  16. GROUP BY 1, 2
  17. ORDER BY 1 DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement