Closed ashrafalzyoud closed 3 years ago
Hi,
You should try to separate the counting:
my_value_471 = CustomValue.where("custom_field_id = 471 AND value ='259'").pluck(:customized_id).uniq.size.to_i
my_value_472 = CustomValue.where("custom_field_id = 472 AND value ='1'").pluck(:customized_id).uniq.size.to_i
self.custom_field_values = { 463=> (my_value_471.to_i + my_value_472.to_i).to_s }
I hope it helps!
i cant separate it i need issue have( custom_field_id = 471 AND value ='259) and (("custom_field_id = 472 AND value ='1'")) example:- issues ( custom_field_id = 471 AND value ='259) = 100 issues (custom_field_id = 472 AND value ='1) = 50 issues have both = 20 this correct answer in your formula the answer is 150
@AirTibu
@AirTibu
Hi,
You should try this code:
my_value_471 = CustomValue.where("custom_field_id = 471 AND value ='259'").pluck(:customized_id)
my_value_472 = CustomValue.where("custom_field_id = 472 AND value ='1'").pluck(:customized_id)
self.custom_field_values = { 463=> (my_value_471 & my_value_472).uniq.size.to_i.to_s }
I hope it helps!
self.custom_field_values = { 463=> Issue.joins(:custom_values).where(custom_values: {custom_field_id: 472, value: "1"},custom_values: {custom_field_id: 471, value: "259"},tracker_id: 45,project_id: ([84])).distinct.size
what wrong for this code ??? my code not working if im put TOW custom_field_id ITS ACCEPTE JUST ONE CFS[472] OR CFS[471]