Zammad 3.4
I need the full list for integrating notification rest api. The rest API returns type_lookup_id.
Which Ruby File / db table should I refer to to get the Notification types against type_lookup_id?
Like -
6 - (probably) Escalasion
3 - Ticket Created
Found it in the type_lookup db table.
But I cannot yet find the type_lookup_id for escalation cases.
Are these (escalation and deescalation) same as switch to and ended switch to (type 4 and 5)?
Hello,
I’m not a developer and can’t directly answer your question.
My guess currently is that you’re turning into the wrong corner here.
The “escalated” state actually is no existing state, more of a virtual thing.
It get’s renamed in the UI - you can find the part of the UI here:
rowClass: ->
@priorityClass()
getState: ->
type = App.TicketState.findNative(@state_id)
stateType = App.TicketStateType.findNative(type.state_type_id)
state = 'closed'
if stateType.name is 'new' || stateType.name is 'open'
state = 'open'
# if ticket is escalated, overwrite state
if @escalation_at && new Date( Date.parse(@escalation_at) ) < new Date
state = 'escalating'
else if stateType.name is 'pending reminder'
state = 'pending'
# if ticket pending_time is reached, overwrite state
if @pending_time && new Date( Date.parse(@pending_time) ) < new Date
state = 'open'
else if stateType.name is 'pending action'
state = 'pending'
Technically, to find current escalated tickets, the application runs the following query:
class Stats::TicketEscalation
def self.generate(user)
open_state_ids = Ticket::State.by_category(:open).pluck(:id)
# get users groups
group_ids = user.group_ids_access('full')
# owned tickets
own_escalated = Ticket.where(
'owner_id = ? AND group_id IN (?) AND state_id IN (?) AND escalation_at < ?', user.id, group_ids, open_state_ids, Time.zone.now
).count
# all tickets
all_escalated = Ticket.where(
'group_id IN (?) AND state_id IN (?) AND escalation_at < ?', group_ids, open_state_ids, Time.zone.now
).count
average = '-'
state = if own_escalated.zero?
Not sure what your goal is, but I currently think you’ll need the workaround via a ticket search.
sudipta
September 8, 2020, 8:00pm
4
Hi,
Your inputs are much appreciated. I was indeed looking in the wrong direction. I have worked it out in a different way and what I needed is working.
I will mark this request as solved now.