fix: Unattendeed conversation count in agent metrics (#4568)

This commit is contained in:
Aswin Dev P.S
2022-04-27 18:56:35 +05:30
committed by GitHub
parent 4250c40d1d
commit 95c7a24dd1
2 changed files with 35 additions and 11 deletions

View File

@@ -96,7 +96,7 @@ class V2::ReportBuilder
def conversations
@open_conversations = scope.conversations.where(account_id: @account.id).open
first_response_count = scope.reporting_events.where(name: 'first_response', conversation_id: @open_conversations.pluck('id')).count
first_response_count = @account.reporting_events.where(name: 'first_response', conversation_id: @open_conversations.pluck('id')).count
metric = {
open: @open_conversations.count,
unattended: @open_conversations.count - first_response_count