2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2015-10-29 09:07:45 +00:00
|
|
|
class Report::TicketBacklog < Report::Base
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
result = Report::TicketBacklog.aggs(
|
2019-03-26 00:17:17 +00:00
|
|
|
range_start: Time.zone.parse('2015-01-01T00:00:00Z'),
|
|
|
|
range_end: Time.zone.parse('2015-12-31T23:59:59Z'),
|
2015-10-29 09:07:45 +00:00
|
|
|
interval: 'month', # quarter, month, week, day, hour, minute, second
|
|
|
|
selector: selector, # ticket selector to get only a collection of tickets
|
2019-03-26 00:17:17 +00:00
|
|
|
timezone: 'Europe/Berlin',
|
2015-10-29 09:07:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
returns
|
|
|
|
|
|
|
|
[4,5,1,5,0,51,5,56,7,4]
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
2019-03-26 00:17:17 +00:00
|
|
|
def self.aggs(params_origin)
|
|
|
|
params = params_origin.dup
|
2015-10-29 09:07:45 +00:00
|
|
|
|
|
|
|
local_params = params.clone
|
|
|
|
local_params[:params] = {}
|
|
|
|
|
|
|
|
local_params[:params][:field] = 'created_at'
|
|
|
|
created = Report::TicketGenericTime.aggs(local_params)
|
|
|
|
|
2016-09-14 07:15:30 +00:00
|
|
|
local_params[:params][:field] = 'close_at'
|
2015-10-29 09:07:45 +00:00
|
|
|
closed = Report::TicketGenericTime.aggs(local_params)
|
|
|
|
|
|
|
|
result = []
|
2017-10-01 12:25:52 +00:00
|
|
|
(0..created.length - 1).each do |position|
|
2015-10-29 09:07:45 +00:00
|
|
|
count = created[position] - closed[position]
|
|
|
|
result.push count
|
2017-10-01 12:25:52 +00:00
|
|
|
end
|
2015-10-29 09:07:45 +00:00
|
|
|
result
|
|
|
|
end
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
result = Report::TicketBacklog.items(
|
2019-03-26 00:17:17 +00:00
|
|
|
range_start: Time.zone.parse('2015-01-01T00:00:00Z'),
|
|
|
|
range_end: Time.zone.parse('2015-12-31T23:59:59Z'),
|
2015-10-29 09:07:45 +00:00
|
|
|
selector: selector, # ticket selector to get only a collection of tickets
|
|
|
|
)
|
|
|
|
|
|
|
|
returns
|
|
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
def self.items(_params)
|
|
|
|
{}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|