-- not including shell
-- not including breadcrumbs from sqlpage_aide_navigation
-- not including page title from sqlpage_aide_navigation
select 'csv' as component, 'test_suites_'||$test_cycle||'.csv' as filename;
SELECT
test_case_id as id,
test_case_title AS "title",
group_name AS "group",
test_status,
created_by as "Created By",
formatted_test_case_created_at as "Created On",
priority as "Priority"
FROM test_cases t
WHERE ($test_cycle IS NULL
OR EXISTS (
SELECT 1
FROM json_each(test_cycles)
WHERE value = $test_cycle
))AND (
$status IS NULL
OR LOWER($status) = 'passed' AND LOWER(COALESCE(test_status, '')) = 'passed'
OR LOWER($status) = 'failed' AND LOWER(COALESCE(test_status, '')) = 'failed'
);