Project

General

Profile

Postgresql query to filter with CF

Added by Mohamed El Habchi over 1 year ago

Hi,
I have an external reporting wich built under PHP,
I'm indeed of creating a query which print the count of custom fields, but i can't get the right query to add filter by CF id/name
below is my query which provide the data for particular status and the output is for the CF chosen, but how can I filter this output with another custom field (will be drop-down in php) and get the same category (CF 134 below).
While checking the table (issues) all custom fileds values are stored in one column!

select value as category, count(value) as value from custom_values where custom_field_id = '134' and customized_id in (select id from issues where tracker_id = '42' and created_on >= '2022-09-01 00:00:00' and created_on <= '2022-09-01 23:59:59' and status_id = '27') group by category order by value desc;

Any guidance will be much appreciated


    (1-1/1)